我在InfluxDB中有一个测量,可以跟踪系统的状态。例如,请考虑以下措施:
03/22/18 00:00:00AM STATUS_A
03/22/18 09:00:00AM STATUS_B
03/22/18 13:00:00AM STATUS_C
03/22/18 18:00:00AM STATUS_B
03/22/18 19:00:00AM STATUS_D
03/22/18 21:00:00AM STATUS_A
我现在需要做的是每天获得系统在每个州的持续时间。在上面的例子中,所需的结果类似于
STATUS_A 12h (from 00:00 to 09:00 and from 21:00 to 24:00)
STATUS_B 5h (from 09:00 to 13:00 and from 18:00 to 19:00)
STATUS_C 5h (from 13:00 to 18:00)
STATUS_D 2h (from 09:00 to 21:00)
我对TICK堆栈很新,所以我可能会遗漏一些非常基本的东西。我当时想用Kapacitor来创建聚合结果,但我真的不知道如何获得结果