2017-07-24 123 views
0

如何透视App Insights分析查询的结果?应用见解 - 枢轴结果

例如,我想对每一个cloud_RoleInstace值列:

performanceCounters 
| where timestamp > todatetime("2017-07-24T13:44:00.251Z") 
    and timestamp < todatetime("2017-07-24T13:49:00.251Z") 
| where name in ("% Processor Time")//, "Request Execution Time") 
| sort by timestamp asc nulls last 
| project timestamp, value, cloud_RoleInstance 

回答

1

是,只需添加

| evaluate pivot(cloud_RoleInstance) 

或者可能更复杂,但也许更正确的:

| summarize value=sum(value) by bin(timestamp, 1m), cloud_RoleInstance 
| evaluate pivot(cloud_RoleInstance, sum(value)) 

到您的查询:)

也,可以简化您的查询的部分时间使用between操作

| where timestamp between(todatetime("2017-07-24T13:44:00.251Z")..todatetime"2017-07-24T13:49:00.251Z") 
+0

快速的问题:能总结一下'计数()'与支点?即时通讯只能获得0和1,我相信这表示该线路是否存在价值? – Leonardo

+0

它看起来像你可以做'枢轴(cloud_RoleInstance,SUM(值)',从文档,它看起来像只'count'和'sum'目前支持? –

+0

没有运气约翰...'枢轴(列数())'返回相同的0和1 ... – Leonardo