How do I pull get total number of elements in percentile query?
I have a query which parses some percentiles based on execution time, but what I would like to know is how do I figure out how many of those tasks are being represented in the calculation.
Here is the base query:
"task elapsed time"
| json field=_raw "arg0.taskType", "arg0.taskElapsedTime" as task, time
| parse regex field=_sourceHost "hostname.(?<datacenter>.*?)\.com"
| time / 1000 as secs |
| pct(secs, 50, 95, 99) by task, datacenter | sort by _secs_pct_99
this gives me
datacenter, task, pct50, pct95, pct99
taskA, DC-A, 1 second, 2 seconds, 2.5 seconds
taskB, DC-A, 1.5 seconds, 2 seconds, 2.5 seconds
taskA, DC-B, 1 second, 2 seconds, 3 seconds
What I am hoping to accomplish is the following output:
datacenter, task, pct50, pct95, pct99, count
taskA, DC-A, 1 second, 2 seconds, 2.5 seconds, 30 tasks run
taskB, DC-A, 1.5 seconds, 2 seconds, 2.5 seconds, 40 tasks, run
taskA, DC-B, 1 second, 2 seconds, 3 seconds, 15 tasks run
Is there a way to keep the pct aggregate and mix it with the total count?
Please sign in to leave a comment.
Comments
1 comment