Below Appinsights analytics query displays the RPS w.r.t time stamp for a given duration.
let start=datetime("2021-04-13T18:35:00.000Z"); let end=datetime("2021-04-13T18:52:00.000Z"); requests | where timestamp > start and timestamp < end | summarize RequestPerSecond = sum(itemCount) by bin(timestamp, 1s)
Output "timestamp [UTC]",RequestPerSecond "4/13/2021, 6:36:39.000 PM",2429 "4/13/2021, 6:36:40.000 PM",2292 "4/13/2021, 6:36:41.000 PM",2055
I need a AI analytics query that will calculate Average of RPS from above result and display output in below format
Metrics, AverageRequestPerSecond RequestPerSecond,2258
where 2258 is Avg of(2429,2292,2055)
Appreciate if any one can help on this
request per second in a specific time range means we need to got the sum count in this period and got the time difference between the start time and end time, so I tried this query:
let start=datetime("2021-04-28 5:40:00.000Z");
let end=datetime("2021-04-28 5:42:00.000Z");
requests
| where timestamp > start and timestamp < end
| summarize req_count_per_sec = todecimal(sum(itemCount))/todecimal(datetime_diff('second',end,start))