0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-26 05:47:20 +00:00

prevent reporting negative retention when the db is empty ()

This commit is contained in:
Costa Tsaousis 2023-08-11 23:37:35 +03:00 committed by GitHub
parent fe2e3eea60
commit a66e22730d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1014,7 +1014,12 @@ size_t rrdeng_disk_space_used(STORAGE_INSTANCE *db_instance) {
time_t rrdeng_global_first_time_s(STORAGE_INSTANCE *db_instance) {
struct rrdengine_instance *ctx = (struct rrdengine_instance *)db_instance;
return __atomic_load_n(&ctx->atomic.first_time_s, __ATOMIC_RELAXED);
time_t t = __atomic_load_n(&ctx->atomic.first_time_s, __ATOMIC_RELAXED);
if(t == LONG_MAX || t < 0)
t = 0;
return t;
}
size_t rrdeng_currently_collected_metrics(STORAGE_INSTANCE *db_instance) {