]> arthur.barton.de Git - netdata.git/commitdiff
rotate health log at 10000 entries by default; properly calculate the max_unique_id...
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sun, 16 Oct 2016 17:13:53 +0000 (20:13 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sun, 16 Oct 2016 17:13:53 +0000 (20:13 +0300)
src/health.c

index 468a0bac3bc17eaea13785caf10203157bec7867..1a8708e70cacfd0482261276c12b5807fa8c3b46 100644 (file)
@@ -51,7 +51,7 @@ static inline void health_log_rotate(void) {
     static size_t rotate_every = 0;
 
     if(unlikely(rotate_every == 0)) {
-        rotate_every = (size_t)config_get_number("health", "rotate log every lines", 100);
+        rotate_every = (size_t)config_get_number("health", "rotate log every lines", 10000);
         if(rotate_every < 100) rotate_every = 100;
     }
 
@@ -140,7 +140,7 @@ static inline void health_alarm_log_save(RRDHOST *host, ALARM_ENTRY *ae) {
 }
 
 static inline ssize_t health_alarm_log_read(RRDHOST *host, FILE *fp, const char *filename) {
-    uint32_t max_unique_id = 0, max_alarm_id = 0;
+    static uint32_t max_unique_id = 0, max_alarm_id = 0;
     ssize_t loaded = -1, updated = -1, errored = -1, duplicate = -1;
 
     errno = 0;