From: Sebastian Harl Date: Sat, 5 Jul 2014 08:25:31 +0000 (+0200) Subject: store: Reduce logging about "old" values. X-Git-Tag: sysdb-0.3.0~81 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f922c934ade661b38047d405cb2b065152d6a526;p=sysdb.git store: Reduce logging about "old" values. Don't log, if the same timestamp was used to submit the value. This avoids excessive noise in the logs on high sampling rates. --- diff --git a/src/core/store.c b/src/core/store.c index 605dfc0..49aaeb2 100644 --- a/src/core/store.c +++ b/src/core/store.c @@ -253,7 +253,7 @@ store_obj(sdb_llist_t *parent_list, int type, const char *name, old = STORE_OBJ(sdb_llist_search_by_name(parent_list, name)); if (old) { - if (old->last_update >= last_update) { + if (old->last_update > last_update) { sdb_log(SDB_LOG_DEBUG, "store: Cannot update %s '%s' - " "value too old (%"PRIscTIME" < %"PRIscTIME")", SDB_STORE_TYPE_TO_NAME(type), name, @@ -262,6 +262,11 @@ store_obj(sdb_llist_t *parent_list, int type, const char *name, * backends */ status = 1; } + else if (old->last_update == last_update) { + /* don't report an error and also don't even log this to avoid + * excessive noise on high sampling frequencies */ + status = 1; + } else { sdb_time_t interval = last_update - old->last_update; old->last_update = last_update;