I'm developing a nagios plugin to get some performance metrics from a NetApp Device using the SDK API. I would like to get the Disk Busy and Disk Latency values for each disk but I need some help with the counter values.
Does anybody know what is the arithmetic to get the following counter metrics using the API?:
The counters that you get from the API are not as described, they are like SNMP counters i.e. continuously increasing but modulo 2^32 or 2^64. You need to fetch the counters, wait for the time you are interested in, fetch the counters again and calculate the difference. Even though the counters wrap around the difference is correct. Once you have a delta you need to divide it by the correct delta base so the value for io_queued is (io_queued(2) - io_queued(1)) / (base_for_disk_busy(2) - base_for_disk_busy(1)). For the ops counters you need to divide by elapsed time. If you are doing continuous measurements then you can just save the current values to use as old values for the next run.
I am pretty sure that this is how stats works as well. It copies the counters, waits for a second then copies the counters and calculates the deltas.