0

我发现,我需要百分位数函数来提取中位数。不过,我还没有真正得到结果。我想知道平均有多少邮件被归档,而异常值不会扭曲结果。customDimensions.AmountStored 包含有关存储了多少邮件的信息。

我正在使用这个查询:

AllShards_CustomEvents 
| where name == "Mail.Implementation.StoreCount" 
| extend storeCount = toint(customDimensions.AmountStored)
| project timestamp, shard=tostring(customDimensions.ShardName), storeCount
| summarize percentiles(storeCount, 5, 50, 95) by bin(timestamp, 7d), shard
4

1 回答 1

1

也许,我遗漏了一些东西 - 但下面的查询似乎工作正常。也许,您可以澄清什么对您不起作用?

let AllShards_CustomEvents = datatable(timestamp:datetime, name:string, customDimensions:dynamic)
[
    datetime(2020-03-30 16:55), "Mail.Implementation.StoreCount", dynamic({'AmountStored': 100}),
    datetime(2020-03-30 16:57), "Mail.Implementation.StoreCount", dynamic({'AmountStored': 200}),
    datetime(2020-03-30 16:57), "Mail.Implementation.StoreCount", dynamic({'AmountStored': 300}),
    datetime(2020-03-30 16:57), "Mail.Implementation.StoreCount", dynamic({'AmountStored': 400}),
    datetime(2020-03-30 16:57), "Mail.Implementation.StoreCount", dynamic({'AmountStored': 500}),
];
AllShards_CustomEvents 
| where name == "Mail.Implementation.StoreCount" 
| extend storeCount = toint(customDimensions.AmountStored)
| project timestamp, shard=tostring(customDimensions.ShardName), storeCount
| summarize percentiles(storeCount, 5, 50, 95) by bin(timestamp, 7d), shard
|timestamp|shard|percentile_storeCount_5|percentile_storeCount_50|percentile_storeCount_95|
|---|---|---|---|---|
|2020-03-30 00:00:00.0000000||100|300|500|
于 2020-03-30T16:58:49.180 回答