Fix rrd4j database start time (#15277)

Signed-off-by: Jan N. Klug <github@klug.nrw>
This commit is contained in:
J-N-K 2023-07-20 21:42:27 +02:00 committed by GitHub
parent f8968b780a
commit 0beaada48c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -587,7 +587,7 @@ public class RRD4jPersistenceService implements QueryablePersistenceService {
RrdDefConfig useRdc = getRrdDefConfig(itemName); RrdDefConfig useRdc = getRrdDefConfig(itemName);
if (useRdc != null) { if (useRdc != null) {
rrdDef.setStep(useRdc.step); rrdDef.setStep(useRdc.step);
rrdDef.setStartTime(System.currentTimeMillis() / 1000 - 1); rrdDef.setStartTime(System.currentTimeMillis() / 1000 - useRdc.step);
rrdDef.addDatasource(DATASOURCE_STATE, useRdc.dsType, useRdc.heartbeat, useRdc.min, useRdc.max); rrdDef.addDatasource(DATASOURCE_STATE, useRdc.dsType, useRdc.heartbeat, useRdc.min, useRdc.max);
for (RrdArchiveDef rad : useRdc.archives) { for (RrdArchiveDef rad : useRdc.archives) {
rrdDef.addArchive(rad.fcn, rad.xff, rad.steps, rad.rows); rrdDef.addArchive(rad.fcn, rad.xff, rad.steps, rad.rows);