首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >测量使用Kusto查询执行的命令的成功率

测量使用Kusto查询执行的命令的成功率
EN

Stack Overflow用户
提问于 2021-06-07 21:21:07
回答 1查看 313关注 0票数 0

我正在试图找到命令的成功率(例如调用)。我已经设置了标志成功的场景标记,并收集了数据。现在,我正在使用Kusto查询创建一个仪表板,该仪表板在触发命令时测量成功率。

我试图使用百分位数来测量在一段时间内使用的命令的成功率,如下所示。

代码语言:javascript
复制
Table
| where Table_Name == "call_command" and Table_Step == "CommandReceived" 
| parse Table_MetaData with * "command = " command: string "," *
| where command == "call"
| summarize percentiles(command, 5, 50, 95) by Event_Time

当“识别错误”发生时,上面的查询抛出一个错误。另外,这是找到命令成功率的正确方法吗?

更新:

接续命令o/p :

代码语言:javascript
复制
    call_command CommandReceived OK         null       null 1453 null [command = call,id = b444,retryAttempt = 0] [null] [null] 

不成功命令o/p :

代码语言:javascript
复制
    call_command STOP   ERROR      INVALID_VALUE Failed to execute command: call, id: b444, status code: 0, error code: INVALID_VALUE, error details: . 556  [command = call,id = b444,retryAttempt = 0] [null] [null]
代码语言:javascript
复制
Table name - call_command
Table_step - CommandReceived/STOP 
Table_Metadata - [command = call,id = b444,retryAttempt = 0]
Table_status - OK/ERROR
EN

回答 1

Stack Overflow用户

发布于 2021-06-08 10:25:02

百分位数要求第一个参数为数值/bool/timespan/datetime,字符串参数无效。第一步似乎是提取调用是否成功,一旦有了这样的列,就可以计算出它的百分位数。下面是一个类似于用例的示例:

代码语言:javascript
复制
let Table = datatable(Event_Time:datetime, Table_MetaData:string) [datetime(2021-05-01),"call_command CommandReceived OK         null       null 1453 null [command = call,id = b444,retryAttempt = 0] [null] [null] "
,datetime(2021-05-01),"call_command CommandReceived OK         null       null 1453 null [command = call,id = b444,retryAttempt = 0] [null] [null] "
,datetime(2021-05-01),"call_command STOP   ERROR      INVALID_VALUE Failed to execute command: call, id: b444, status code: 0, error code: INVALID_VALUE, error details: . 556  [command = call,id = b444,retryAttempt = 0] [null] [null]"]
| extend CommandStatus = split(Table_MetaData, " ")[2]
| extend Success = iif(CommandStatus == "OK", true, false)
| parse Table_MetaData with * "command = " command: string "," *
| where command == "call"
| summarize percentiles(Success, 5, 50, 95) by bin(Event_Time,1d);
Table
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67878823

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档