I want to display a rate using the Lost Packages counter that my device provides.
(e.g. Lost Packages/s)
I was planning to use the Class Library RateCalculator class from the common namespace.
The CalculateRate method requires a delta and minDelta argument to be provided.
What would be the best way to get a delta and what would be a good value for minDelta?
Note: the protocol uses HTTP sessions to communicate with the device, so I can't use the GetSnmpGroupExecutionDelta method.
Additionally, do I need to make my polling timer fixed?
Edit: Please look at the answers from David, Simon and Miguel!
They all contain valid things to look out for during development.
Answer provided by David regarding delta calculation is correct but let me add my 2 cents regarding making the polling timer fixed:
You have 2 options there, the easy one is indeed to make that timer fixed.
The other option is to leave it configurable but in that case, you'll need to retrieve the value of the [Timer base] DataMiner Internal parameter of your element (parameter id="65017") and take it into account in order to define your minDelta.
Note that another (even better) approach is to let the end user define the minDelta as this might depend from one device to another. It might even depend from one interface to another on the same device.
In that case, you can buffer the delta and counter values and calculate the rate by using the current value against the 'latest value older than (currentTime - minDelta)'.
This is a better approach as if we poll counter values and calculate rates faster than the device itself updates its counters, it might lead to misleading results.
Note that a task has been made to update the Class Library and protocol SDF according to this last approach.