DQL
Questions about Dynatrace Query Language
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Percentile calculation

enrico_afkl
Visitor

 

Hello,
I have this query and would like to find out which endpoints fall within the 98th percentile:

timeseries {
totalCalls = sum(log.prgoffer.foapi.baminfo.httpmethod,
filter: isNotNull(endpoint)),

successCalls = sum(log.prgoffer.foapi.baminfo.httpmethod,
filter: isNotNull(endpoint)
and matchesValue(baminfo.exception,"OK")),

by:endpoint
},

interval: 5m

| fieldsAdd successRatio = successCalls[] / totalCalls[] * 100
| fieldsRemove successCalls, totalCalls

thanks for all support 🙂 !

6 REPLIES 6

p_devulapalli
Leader

@enrico_afkl You can try the "arrayPercentile", please see below

https://docs.dynatrace.com/docs/shortlink/array-functions#array-percentile

 

Phani Devulapalli

Thank you very much! With this query, I now have the following:

timeseries total=avg(log.prgoffer.foapi.baminfo.soap.duration) by: {baminfo.provider}
| fieldsAdd p99 = arrayPercentile(total, 99)
| fieldsRemove timeframe, interval, total

A chart showing the 99th percentile by category.

enrico_afkl_0-1782304845962.png

 

Is it possible to see how the P99 has changed over time for each provider? (Using a line chart)

@enrico_afkl  Yes, you might need to modify the DQL a bit, please try the below 

timeseries p99=percentile(log.prgoffer.foapi.baminfo.soap.duration, 99) , by: { baminfo.provider }
Phani Devulapalli

I and thanks for your answer 🙂
I thought that was the right solution but when I tried I had "no records" answer whereas with the previous query I do have values within the same range so I am puzzled.

enrico_afkl_0-1782370478410.png

 

do you understand why?

@enrico_afkl The data that you are querying , is that a timeseries data? What if you try to get a average , do you see data?

timeseries avg(log.prgoffer.foapi.baminfo.soap.duration) , by: { baminfo.provider }

 

Phani Devulapalli

I did this for the first query, but now i would like to have the evolution in time with a line chart

Featured Posts