1

如何透视 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 
4

1 回答 1

2

是的,只需添加

| 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")   
于 2017-07-28T23:04:36.183 回答