我们的传感器以不规则的时间间隔生成值
12:00 10 12:02 20 12:22 30 12:29 40
我试图找到一个时间序列数据库,可以自动计算某些常规时间间隔(例如10分钟)的平均值。 当然,值在区间内有效的时间越长,它在平均值中的权重就越大(时间加权平均值)。 (例如12:00-12:10:(10 * 2 + 20 * 8)/ 10 = 18))
我现在正在互联网上搜索几个小时,发现很多时间序列数据库,讨论不规则的时间序列(例如InfluxDB,OpenTDSB等),并且大多数数据库都有一些带有聚合函数的类似SQL的查询语言。
不幸的是,他们没有说明如何平均不规则的时间间隔。 由于我不想尝试所有这些,有人可以告诉我哪些数据库支持计算时间加权平均值? 谢谢!
Our sensors produce values in irregular time intervals:
12:00 10 12:02 20 12:22 30 12:29 40
I am trying to find a time series database that can automatically calculate the average value for certain regular time intervals (e.g. 10min). Of course the longer a value was valid within the interval the more weight it has in the average (time weighted average). (e.g. 12:00-12:10: (10*2+20*8)/10=18) )
I am searching now on the internet for hours and found lots of time series databases that talk about irregular time series (e.g. InfluxDB, OpenTDSB, etc.) and most of them have some SQL-like query language with aggregation functions.
Unfortunately they don't say how exactly irregular time intervals are averaged. As I don't want to try all of them, can someone tell me which databases support the calculation of a time-weighted-average? Thanks!
最满意答案
OpenTSDB在查询隐含的时间内在查询中的所有系列中执行聚合。 对于在时间戳上没有数据值的任何系列,它会从前后的值线性插值。 它在查询时进行“上采样” - 原始数据始终存储在它到达时的状态。 您可以执行尾随窗口时间平均值,但不是指数加权移动平均线(我相信这是您按时间加权的含义吗?)
http://opentsdb.net/docs/build/html/user_guide/query/aggregators.html
(我应该补充一点,这不是对你应该使用的数据库的OpenTSDB的一揽子推荐,我只是回答你的问题)
OpenTSDB performs aggregation across all series in a query at the time(s) implied by the query. For any series not having a data value at a timestamp, it linearly interpolates a value from the values before and after. It does this "upsampling" at query time -- the original data is always stored as it was when it arrived. You can perform a trailing windowed time average, but not an exponentially weighted moving average (I believe that is what you meant by time-weighted?)
http://opentsdb.net/docs/build/html/user_guide/query/aggregators.html
(I should add, that's not a blanket recommendation for OpenTSDB as the db you should use, I'm just responding to your question)
更多推荐
发布评论