Appinsights analytics Query to calculate Avg Rps for given duration

%3CLINGO-SUB%20id%3D%22lingo-sub-2273972%22%20slang%3D%22en-US%22%3EAppinsights%20analytics%20Query%20to%20calculate%20Avg%20Rps%20for%20given%20duration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2273972%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Team%2C%3C%2FP%3E%3CP%3EBelow%20Appinsights%20analytics%20query%20displays%20the%20RPS%20w.r.t%20time%20stamp%20for%20a%20given%20duration.%3C%2FP%3E%3CP%3Elet%20start%3Ddatetime(%222021-04-13T18%3A35%3A00.000Z%22)%3B%3CBR%20%2F%3Elet%20end%3Ddatetime(%222021-04-13T18%3A52%3A00.000Z%22)%3B%3CBR%20%2F%3Erequests%3CBR%20%2F%3E%7C%20where%20timestamp%20%26gt%3B%20start%20and%20timestamp%20%26lt%3B%20end%3CBR%20%2F%3E%7C%20summarize%20RequestPerSecond%20%3D%20sum(itemCount)%20by%20bin(timestamp%2C%201s)%3C%2FP%3E%3CP%3EOutput%3CBR%20%2F%3E%22timestamp%20%5BUTC%5D%22%2CRequestPerSecond%3CBR%20%2F%3E%224%2F13%2F2021%2C%206%3A36%3A39.000%20PM%22%2C2429%3CBR%20%2F%3E%224%2F13%2F2021%2C%206%3A36%3A40.000%20PM%22%2C2292%3CBR%20%2F%3E%224%2F13%2F2021%2C%206%3A36%3A41.000%20PM%22%2C2055%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EI%20need%20a%20AI%20analytics%20query%20that%20will%20calculate%20Average%20of%20RPS%20from%20above%20result%20and%20display%20output%20in%20below%20format%3CBR%20%2F%3EMetrics%2C%20AverageRequestPerSecond%3CBR%20%2F%3ERequestPerSecond%2C2258%3C%2FP%3E%3CP%3EAppreciate%20if%20any%20one%20can%20help%20on%20this%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi Team,

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

Appreciate if any one can help on this

0 Replies