一些基本的东西:我正在尝试创建一个“正在运行”的查询,在该查询中,对于每个数据点,我都会得到平均值并计数到该点,以及值。例如对于这些测量:
hunger=1 1001
hunger=3 1002
hunger=5 1003
hunger=20 1004
我想生成一个看起来像这样的 csv:
timestamp, hunger, mean, count,
1001, 1, 1, 1
1002, 3, 2, 2,
1003, 5, 3, 3
1004, 20, 7.25, 4
由于这是聚合和选择器查询的混合,我在单独的查询中“饥饿”然后是平均和计数。但是,如果我将两者都分组time(1s)
,我的平均值和计数将仅与组大小相关;我需要它与当时的整个设置相关...有什么建议吗?