How to fetch P(90) P(99) metrics in new relic

Hi Team,
I am running a simple script which redirects metrics to statsd then to new relic. As part of end of test summary I see below
avg=48.41ms min=44.9ms med=47.85ms max=60.38ms p(90)=50.48ms p(99.9)=60.17ms p(99.99)=60.36ms

I am creating dashboard on new relic and want to have p(90), p(99.9) exact values as shown above to be displayed on my dashboard. unfortunately, I am unable to query them and I have tried below.

SELECT percentile(`k6.http_req_duration`, 90, 95, 99) FROM Metric - returns 0

SELECT sum(k6.http_req_duration.sum.percentiles) AS '90th' FROM Metric WHERE percentile = 90

returns results but I don’t understand the value returned as it is 37.1 k, I am looking for value to be same as end of test summary.

Hi @tanzeem,

I haven’t really worked with new relic queries but I found this doc that might be helpful to you. It also has some queries on how to select the 90th percentile. Also please give it a try with non-aggregative functions of NRQL.

And as of the use of your second query it does sum up all the values of the p90 metric, that’s what the sum function is telling you query and that’s why it does return only one value.