Fix Wrong Interval in BanyanDB Installation Process (#12264)

This commit is contained in:
Gao Hongtao 2024-05-29 23:52:13 +08:00 committed by GitHub
parent 19a2395a9e
commit b21e576a30
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View File

@ -8,6 +8,7 @@
* Fix LAL test query api.
* Add component libraries of `Derby`/`Sybase`/`SQLite`/`DB2`/`OceanBase` jdbc driver.
* Fix setting the wrong interval to day level measure schema in BanyanDB installation process.
#### UI

View File

@ -278,7 +278,7 @@ public enum MetadataRegistry {
case Minute:
return Duration.ofMinutes(1);
case Day:
return Duration.ofDays(1);
return Duration.ofHours(24);
default:
throw new UnsupportedOperationException("unsupported downSampling interval");
}

View File

@ -227,8 +227,9 @@ public class BanyanDBMetricsQueryDAO extends AbstractBanyanDBDAO implements IMet
});
for (final DataPoint dp : resp.getDataPoints()) {
long timeBucket = TimeBucket.getTimeBucket(dp.getTimestamp(), schema.getMetadata().getDownSampling());
if (map.putIfAbsent(timeBucket, dp) != null) {
log.warn("duplicated data point at " + timeBucket);
DataPoint preDp = map.putIfAbsent(timeBucket, dp);
if (preDp != null) {
log.warn("{}:{} returns duplicated data point at {}, pre:{}, current:{}", entityID, schema.getMetadata(), timeBucket, preDp.getFields(), dp.getFields());
}
}