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 (#15796)
This commit is contained in:
parent
fe2e3eea60
commit
a66e22730d
1 changed files with 6 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue