给出以下Kusto query:
range t from bin(now(), 1h)-23h to bin(now(), 1h) step 1h
| summarize t=make_list(t)
| project id='TS', val=dynamic([0,0,0,0,0,0,0,0,0,10,20,40,100,40,20,10,0,0,0,0,0,0,0,0]), t
| extend 5h_MovingAvg=series_fir(val, dynamic([1,1,1,1,1])),
5h_MovingAvg_centered=series_fir(val, dynamic([1,1,1,1,1]), true, true)
| render timechart
我无法获得应用程序见解来实际绘制this document
中显示的移动平均线我还尝试将本文应用于我们的实际应用之一,也没有任何运气。没有错误或其他任何东西可以提示为什么未绘制移动平均线。我假设某个地方最有可能必须进行设置。这是我的自定义查询:
let timeGrain=1d;
let ago = ago(7d);
let mAvgParm = repeat(1, 5);
let dataset=requests
// additional filters can be applied here
| where timestamp >= ago and cloud_RoleName == "recalculateordercombination" and resultCode == 500
| where client_Type != "Browser" ;
// calculate failed request count for all requests
dataset
| make-series dailyFailure=sum(itemCount) default=0 on timestamp in range(ago, now(), timeGrain) by resultCode
// render result in a chart
| extend SMA = series_fir(dailyFailure, mAvgParm)
| render timechart
为使用series_fir
绘制移动平均线而丢失了哪些查询?
我的研究中使用的参考文章
答案 0 :(得分:0)
这两种服务的Web客户端都是不同的,它们的呈现逻辑也是如此。
在Azure数据资源管理器(Kusto)中,您可以仅对时间序列数据(键入为render timechart
)使用dynamic
。
在其他情况下,您可能需要先mv-expand
系列(link to doc),然后再进行渲染。
以下是与您的问题中的第一个查询匹配的示例:
range t from bin(now(), 1h)-23h to bin(now(), 1h) step 1h
| summarize t=make_list(t)
| project id='TS', val=dynamic([0,0,0,0,0,0,0,0,0,10,20,40,100,40,20,10,0,0,0,0,0,0,0,0]), t
| extend 5h_MovingAvg=series_fir(val, dynamic([1,1,1,1,1])),
5h_MovingAvg_centered=series_fir(val, dynamic([1,1,1,1,1]), true, true)
| mv-expand val to typeof(long), t to typeof(datetime), 5h_MovingAvg to typeof(long), 5h_MovingAvg_centered to typeof(long)
| project t, 5h_MovingAvg, 5h_MovingAvg_centered, val
| render timechart