我有一个将测量值发送到 influxDB 数据库的 java 应用程序。
我在我的 influxdb 数据库中添加点。我每次运行程序时添加的点都有当前时间戳。
这就是我添加积分的方式(测量构建):
BatchPoints batchPoints;
Date date = new Date();
String beginofday = Constant.simpledateFormat.format(date);
date = Constant.simpledateFormat.parse(beginofday);
long timestamp = date.getTime();
//adding points
for buildings ... do
Point point = Point.measurement("building").tag(tagsToAdd).fields(fieldsToAdd)
.time(timestamp, TimeUnit.NANOSECONDS).build();
batchPoints.point(point);
我的问题是,当我用这样的请求请求我的数据库时:
select count(tag) from building where time > (my timestamp)
我注意到以前的时间戳结果也被计算在内,即使我正在做时间>时间戳。当我做 > 而不是 >= 它只计算最后一个。我还注意到,对于上一个时间戳,例如,如果我有像这样的时间戳 1540300800000 ns,influxdb 在开头添加一个 6,它变成 61540300800000 ms。
我真的不明白发生了什么。
有任何想法吗?