Kusto 按除法将 Bytes 转换为 MeBytes

Kusto convert Bytes to MeBytes by division

尝试绘制使用 Azure Log Analytics 消耗的带宽图

Perf
| where TimeGenerated > ago(1d)
| where CounterName contains "Network Send"
| summarize sum(CounterValue) by bin(TimeGenerated, 1m), _ResourceId 
| render timechart 

除了 y 轴的范围为 0 - 15,000,000,000 之外,这会生成一个合理的图表。我试过了

Perf
| where TimeGenerated > ago(1d)
| where CounterName contains "Network Send"
| extend MeB_bandwidth_out = todouble(CounterValue)/1,048,576 
| summarize sum(MeB_bandwidth_out) by bin(TimeGenerated, 1m), _ResourceId 
| render timechart 

但我得到了完全相同的图表。我试过不使用 todouble(),或者在除法之后使用它,但没有任何改变。任何提示为什么这不起作用?

在没有看到数据样本的情况下很难说,但这里有一些想法:

  1. 尝试从 1,048,576
  2. 中删除逗号
  3. 如果这不起作用,请从两个查询中删除最后一行并比较结果,然后 运行 看看为什么数据没有意义

P.S。无论如何,您很有可能可以将 contains 替换为 has 以显着提高性能(请注意 has 查找完整单词,而 contains 不查找 - 所以他们不一样,小心)。