gpt4 book ai didi

azure - Application Insights 查询显示请求总数、通过总数和失败总数

转载 作者:行者123 更新时间:2023-12-03 01:20:16 25 4
gpt4 key购买 nike

任何人都可以共享 Azure Application Insights 查询来显示给定测试持续时间内的请求总数、通过总数和失败总数:操作总计计数 已通过 总计失败请求1 10 5 5请求2 10 7 3

最佳答案

感谢@lubumbax您的回答对提高我的查询知识有很大帮助。

此处,我使用查询从应用程序洞察中获取总计数、成功和失败响应。

enter image description here

查询如下:

let TOTAL = requests | where timestamp > ago(1d) | summarize TotalRequests=sum(itemCount) | extend Foo=1;
let Req_TOTAL = materialize(TOTAL);

let FAILED = requests
| where timestamp > ago(1d)
| where resultCode hasprefix "5"
| summarize Failed=sum(itemCount)
| extend Foo=1;
let Req_FAILED = materialize(FAILED);

let SUCCESS = requests
| where timestamp > ago(1d)
| where resultCode hasprefix "2"
| summarize Success=sum(itemCount)
| extend Foo=1;
let Req_SUCCESSED = materialize(SUCCESS);

Req_FAILED
| join kind=inner Req_TOTAL on Foo
| join kind=inner Req_SUCCESSED on Foo
| extend PercentFailed = round(todouble(Failed * 100) / TotalRequests, 2)
| extend PercentSuccess = round(todouble(Success * 100)/ TotalRequests, 2)
| project TotalRequests, Failed, Success, PercentFailed, PercentSuccess; availabilityResults

结果: enter image description here

关于azure - Application Insights 查询显示请求总数、通过总数和失败总数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71107834/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com