2017-07-24 122 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