NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

Software Development Kit (SDK) and API Discussions

avg_latency Measure

julioweber
5,938 Views

Do anyone knows what this numbers means?

 

<instances>

                <instance-data>

                        <name>vol0</name>

                        <counters>

                                <counter-data>

                                        <name>parent_aggr</name>

                                        <value>aggr0_Server1</value>

                                </counter-data>

                                <counter-data>

                                        <name>avg_latency</name>

                                        <value>44592640</value>

                                </counter-data>

                                <counter-data>

                                        <name>total_ops</name>

                                        <value>2561552</value>

                                </counter-data>

 

How can I read the avg_latency counter? Which measure and unit is used in it?

4 REPLIES 4

ryanc
5,938 Views

For a general overview of how the performance counter system works, read through the description found in the SDK here:

<sdk dir>/doc/ontapi/ontapi_1.11/perf/index.html

Of specific interest is the explanation of how to interpret the various counter types:

  • 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

To understand more about a specific counter you can get details from the perf-object-counter-list-info API call:

      <counter-info>
        <name>avg_latency</name>
        <desc>Average latency in microseconds for all operations on the volume</desc>
        <privilege-level>basic</privilege-level>
        <properties>average</properties>
        <unit>microsec</unit>
        <base-counter>total_ops</base-counter>
      </counter-info>

Armed with this info, you should be able to interpret and present the latency values you are interested in. Make two calls to perf-object-get-instances, with a delay between them. Include both avg_latency and total_ops ( the base counter ).

From above we know 'average: delta divided by the delta of a base counter is used'. So perform the following calculation:

(avg_latency2-avg_latency1) / (total_ops2-total_ops1)   => average latency in microseconds

To sanity test your application, compare your output with the output from ONTAP via the CLI:

Actual numbers: (598624907-596952932) / (149998706-149866390) => 12.636

filer1> stats show volume:vol0:avg_latency

volume:vol0:avg_latency:12.57us

Additionally, I'm not sure what language you are working with, but within the samples directory of the SDK there are a couple of perf related applications.

-ryan

Michael_Nye
5,938 Views

Hi Ryan,

Your post has helped me immensely. A thousand thankyous.

-Mike

rle
NetApp Alumni
5,938 Views

You might want to check out this post for some Perl examples using the perf APIs.

Regards,

   - Rick -

Michael_Nye
5,938 Views

Once again - very helpful. Thankyou.

Public