AppInsights 查询以显示每个请求的 RPS

AppInsights query to display RPS of each request

下面的 Application Insights 查询获取每个请求的响应时间。 我们可以扩展上面的查询并为每个请求显示 RequestPerSeconds 吗?

// this query calculates request duration percentiles and count by name
let start=datetime("2021-04-13T18:35:00.000Z");
let end=datetime("2021-04-13T18:52:00.000Z");
let timeGrain=5m;
let dataset=requests
    // additional filters can be applied here
    | where timestamp > start and timestamp < end
    | where client_Type != "Browser"
;
dataset
// change 'operation_Name' on the below line to segment by a different property
| summarize count_=sum(itemCount), avg(duration), percentiles(duration, 50, 95, 99) by operation_Name
// calculate duration percentiles and count for all requests (overall)
| union(dataset
    | summarize count_=sum(itemCount), avg(duration), percentiles(duration, 50, 95, 99)
    | extend operation_Name="Overall")

Output
Operation_Name, count_, avg_duration, percentiles_duration_50, percentiles_duration_95, percentiles_duration_99
Request1,15,2.1,2.3,2.3,2.5
Request2, 10, 1.1,1.2,1.3,1.2

谢谢, 阿尼尔

据我了解,RequestPerSeconds 表示 request total counts / total seconds

根据您的查询,您可以添加

req_count_per_sec = todecimal(sum(itemCount))/todecimal(datetime_diff('second',end,start))