0

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

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

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:

    call_command CommandReceived OK         null       null 1453 null [command = call,id = b444,retryAttempt = 0] [null] [null] 

不成功的命令 o/p :

    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]

Table name - call_command
Table_step - CommandReceived/STOP 
Table_Metadata - [command = call,id = b444,retryAttempt = 0]
Table_status - OK/ERROR
4

1 回答 1

1

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

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
于 2021-06-08T10:25:02.953 回答