计算InfluxDB中开始事件与结束事件之间的持续时间 [英] Calculating duration between a start and end event in InfluxDB

查看:454
本文介绍了计算InfluxDB中开始事件与结束事件之间的持续时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为InfluxDB有两个写点,一个是开始,另一个是结束.我只需要确定这两个事件之间的持续时间,并对其进行查询. InfluxDB具有difference()聚合方法,但不适用于时间元字段.

I have two write points for InfluxDB, one is the start and the other is the end. I just need to determine the duration between those two events, and make queries around it. InfluxDB has difference() aggregate method, but it doesn't work on the time meta field.

提供自定义时间戳记值是完成此操作的唯一方法吗?

Is supplying a custom timestamp value the only way to accomplish this?

推荐答案

按照"我可以针对时间戳执行数学运算吗?"

否:

当前,无法对InfluxDB中的时间戳值执行数学运算符.大多数时间计算必须由接收查询结果的客户端执行."

"Currently, it is not possible to execute mathematical operators against timestamp values in InfluxDB. Most time calculations must be carried out by the client receiving the query results."

是的,也许是:

函数ELAPSED()返回单个字段中后续时间戳之间的差.

The function ELAPSED() returns the difference between subsequent timestamps in a single field.

所以这取决于数据的形状.

So it depends on the shape of your data.

这篇关于计算InfluxDB中开始事件与结束事件之间的持续时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆