Dashboards & Visualizations

Mark 90% trend in data?

feickertmd
Communicator

A requirement I have is to show API response times over time, marking min, max, avg and 90% range. In other words, be able to say "90% of response time are X milliseconds or lower.

Not sure how to approach it. Advice appreciated.

Tags (1)
0 Karma
1 Solution

jkat54
SplunkTrust
SplunkTrust

Please see the percX(Y) function of the stats command:

http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonStatsFunctions

... | stats perc90(responseTimeField)

View solution in original post

feickertmd
Communicator

I don't think I am looking for percentile. I am looking for frequency.
Take, for instance, this list of 30 values:
0 0 1 1 2 2 2 3 3 4 4 4 5 5 5 5 6 6 6 7 7 7 7 8 8 8 9 9 9 9

In this case, the 90th percentile is 9, but 90% of the values are <=7.

Looking for the second figure.

0 Karma

feickertmd
Communicator

and I am not a stats guy, so I may not be seeing things right!

0 Karma

somesoni2
Revered Legend

Your original requirement says "90% of response time are X milliseconds or lower.", so perc90 is the metrics that you need which say 90% of the entries are 9 or lower (per your example).

0 Karma

feickertmd
Communicator

Thanks. I have played with my sample data a bit more, and I see it better. Like I said, not a stats guy, so I wasn't surprised to find I misunderstood.

0 Karma

jkat54
SplunkTrust
SplunkTrust

🙂 we grade on a curve here.. you're fine!

0 Karma

DalJeanis
Legend

In the search reference, it's listed in the statistical/aggregate functions, and it's called percxx(), where xx in this case would be 90. If you wanted the 90th percentile of the response variable, then it would something look like

| stats min(response) as minresp, max() as maxresp, avg(response) as avgresp, perc90(response) as p90resp by ((whatever))

You should probably read the notes, since there are some interesting things about the function. It actually produces a close estimate that is cheaper and faster to calculate, but you can use exactperc90() to calculate the exact one if you really needed it.

http://docs.splunk.com/Documentation/Splunk/5.0.2/SearchReference/CommonStatsFunctions

0 Karma

jkat54
SplunkTrust
SplunkTrust

Please see the percX(Y) function of the stats command:

http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonStatsFunctions

... | stats perc90(responseTimeField)
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...