Code

store: Reduce logging about "old" values.
authorSebastian Harl <sh@tokkee.org>
Sat, 5 Jul 2014 08:25:31 +0000 (10:25 +0200)
committerSebastian Harl <sh@tokkee.org>
Sat, 5 Jul 2014 08:25:31 +0000 (10:25 +0200)
Don't log, if the same timestamp was used to submit the value. This avoids
excessive noise in the logs on high sampling rates.

src/core/store.c

index 605dfc08b71092756b732a0b77644548693a1586..49aaeb259eb3f0a3b74841e3b88617e9a153a47a 100644 (file)
@@ -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;