Software Development Kit (SDK) and API Discussions

netapp managability sdk 5.1 perf_operation.pl returns invalid results for ext_cache_obj hit_percent

AARON_BOERUP
4,843 Views

I've been building up my cacti templates to monitor my netapp arrays and I'm not having any luck getting flashcache stats in.

perf_operationpl <filer> <username> <password> get-counter-values ext_cache_obj | grep percent

Counter Name = hit_percent   Counter Value = 7706202468

 

These numbers are not a percent...

 

Counter Name = cache_utilization     Counter Value = 92

This one is

 

If I go on to my filer and run the command

filer01> stats show ext_cache_obj:ec0:hit_percent

I get

ext_cache_obj:ec0:hit_percent:9%

 

OnCommand returns the right data, but I'd like to get this data into my cacti system to be able to correlate data with all of the other things cacti monitors.

Does anyone know whats up with this counter?

5 REPLIES 5

aborzenkov
4,843 Views

Please see API documentation - percentage counters are raw values which must be post-processed in relation to other (“base”) counters. Unfortunately, I do not know whether full list of counters and their properties exists so you will need to retrieve them yourself …

AARON_BOERUP
4,843 Views

Found what you are referring to in the API documentation. It means this figure is going to be a little harder to get into cacti than I originally hoped but it should be possible.

The base counter for hit_percent is accesses

Counter Name = hit_percent                  Base Counter = accesses     Privilege_level = basic     Unit = percent

per the API documentation how to convert the hit_percent counter into an actual percent

Each counter has a property which indicates how it's raw value should be interpreted.  This property is available as part of the static counter metadata returned by a call to perf-object-counter-list-info. Possible properties are 'raw', 'rate', 'delta', 'average', 'percent', 'string', and 'no-display'. String counters report textual information, such as volume or disk identifiers. No-display counters are not intended for direct use, and this property is typically assigned to base counters.  The other properties are interpreted as follows:

  • raw: single counter value is used
  • delta: change in counter value between two samples is used
  • rate: delta divided by the time in seconds between samples is used
  • average: delta divided by the delta of a base counter is used
  • percent: 100*average is used

For 'average' and 'percent' counters, the 'base-counter' element will be set to the name of the base counter. Some counters are multidimensional, and for these the counter description includes a list of labels of the counter subelements, and a 'type' element indicating the counter is an array.  For example, again consider the processor::processor_busy counter. The description and properties of this counter state that it is a percentage, but a call to perf-object-get-instances will return a raw number which must be further processed by the user.  Because the counter is a percentage, the user must note the value of its base counter, (processor::processor_elapsed_time) and then make a second call to perf-object-get-instances and again note the raw value of the counter and base counter.  Suppose the user made the calls at time T1 and later at time T2, and these raw values were returned (the object and instance name are not shown):

  • (T1) processor_busy=2000000, processor_elapsed_time=3000000
  • (T2) processor_busy=2400000 ,processor_elapsed_time=4000000

The user must then perform the following computation to determine processor utilization: 100*(2400000-2000000)/(4000000-3000000) = 40%

So I should be doing

100*(hit_percent2-hit_percent1)/(accesses2-accesses1) ?

I just did some math on this and it looks accurate.

100 * (8691067123-8691066647) / (18276793012-18276789090) = 12.13666496685365

aborzenkov
4,843 Views

Yes (but you need to use delta between two measurements, not absolute value).

AARON_BOERUP
4,843 Views

Cacti actually does that part for me automatically as part of the graphing function. Now I just need to figure out how to reprogram the data collection script to return two counter results at the same time instead of slightly delayed, it's not perfectly accurate right now, but is pretty close.

AARON_BOERUP
4,843 Views

Hm, this is a bit beyond my very limited perl skills, anyone feel like taking a crack at it?

Public