我有一张这样桌子/系列
Message MessageValue
--------------- ---------------------
property1 10
property2 9
property3 7
property2 22我想每隔10分钟对property2 2的平均值进行下采样。我怎么能做这样的事情呢?
创建连续查询"cq_10m“ON "DatabaseName”BEGIN SELECT mean(SELECT MessageValue WHERE Message =property2 ) AS "mean_Property2“INTO "RetentionPolicyName"."downsampled_orders”FROM "TableName“GROUP BY time(10m) END
发布于 2018-10-02 15:40:00
它看起来像下面这样。您的CQ将每10分钟查询一次数据库,并计算该时间范围内"MessageValue“的平均值。这将被下采样到: mean_Property2。
CREATE CONTINUOUS QUERY "cq_10m" ON "dbName"
RESAMPLE EVERY 10m FOR 2h
BEGIN SELECT mean("MessageValue") AS mean_Property2 INTO
mean_Property2 FROM "retentionPolicyName"."measurementName" WHERE "Message"='property2'
GROUP BY time(10m) ENDhttps://stackoverflow.com/questions/46450920
复制相似问题