Application Insights 聚合事件发生的总和
Application Insights aggregate sums of event occurrences
我正在应用洞察中记录一个事件 UserRegistered
,这样我就可以看到哪些用户在注册时做了哪些正确的事情。我还想使用此事件来显示随时间推移注册的总用户数。
我目前有这个查询:
customEvents
| where timestamp >= datetime(2021-06-04T16:08:10.602Z) and timestamp < datetime(2021-06-11T16:08:10.602Z)
| summarize ['customEvents/count_sum'] = sum(itemCount) by bin(timestamp, 1d)
| order by timestamp desc
然而,这只给出了每个箱子的总数。因此,如果用户在第 1 天注册,第二天在第 3 天注册,我会看到如下内容:
|
| |
1 2 3
但是,我希望看到随着时间的推移而增长,因此这些箱子需要汇总它们的总和,给我这个:
|
|
| | |
1 2 3
我可以在 App Insights 中实现吗?
试试这个?
customEvents
| where timestamp >= datetime(2021-06-04T16:08:10.602Z) and timestamp < datetime(2021-06-11T16:08:10.602Z)
| summarize ['customEvents/count_sum'] = sum(itemCount) by bin(timestamp, 1d)
| order by timestamp desc
| extend total=row_cumsum(['customEvents/count_sum'])
我正在应用洞察中记录一个事件 UserRegistered
,这样我就可以看到哪些用户在注册时做了哪些正确的事情。我还想使用此事件来显示随时间推移注册的总用户数。
我目前有这个查询:
customEvents
| where timestamp >= datetime(2021-06-04T16:08:10.602Z) and timestamp < datetime(2021-06-11T16:08:10.602Z)
| summarize ['customEvents/count_sum'] = sum(itemCount) by bin(timestamp, 1d)
| order by timestamp desc
然而,这只给出了每个箱子的总数。因此,如果用户在第 1 天注册,第二天在第 3 天注册,我会看到如下内容:
|
| |
1 2 3
但是,我希望看到随着时间的推移而增长,因此这些箱子需要汇总它们的总和,给我这个:
|
|
| | |
1 2 3
我可以在 App Insights 中实现吗?
试试这个?
customEvents
| where timestamp >= datetime(2021-06-04T16:08:10.602Z) and timestamp < datetime(2021-06-11T16:08:10.602Z)
| summarize ['customEvents/count_sum'] = sum(itemCount) by bin(timestamp, 1d)
| order by timestamp desc
| extend total=row_cumsum(['customEvents/count_sum'])