]> arthur.barton.de Git - netdata.git/commitdiff
backend buffer should always be incremental
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sat, 28 Jan 2017 16:45:52 +0000 (18:45 +0200)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sat, 28 Jan 2017 16:45:52 +0000 (18:45 +0200)
src/backends.c
src/plugin_proc_diskspace.c

index 9b91b7f0a5ddac65bfc9b226977820045e0253d8..4250e31c4b2d89e95e551680886bfd61fc466d9d 100644 (file)
@@ -349,6 +349,10 @@ void *backends_main(void *ptr) {
         //fprintf(stderr, "\nBACKEND BEGIN:\n%s\nBACKEND END\n", buffer_tostring(b)); // FIXME
         //fprintf(stderr, "after = %lu, before = %lu\n", after, before);
 
+        // prepare for the next iteration
+        // to add incrementally data to buffer
+        after = before;
+
         // ------------------------------------------------------------------------
         // if we are connected, receive a response, without blocking
 
@@ -454,12 +458,6 @@ void *backends_main(void *ptr) {
                 close(sock);
                 sock = -1;
             }
-
-            // either the buffer is empty
-            // or is holding the data we couldn't send
-            // so, make sure the next iteration will continue
-            // from where we are now
-            after = before;
         }
         else {
             error("Failed to update database backend '%s'", destination);
index dbd7531c7cd29c7c823af94ba3b5d940bb5a4ff3..689efe7c7a0d93a3fbbe4b9cf9494bff0d848dd8 100644 (file)
@@ -237,7 +237,7 @@ void *proc_diskspace_main(void *ptr) {
     heartbeat_init(&hb);
     for(;;) {
         duration = heartbeat_dt_usec(&hb);
-        usec_t hb_dt = heartbeat_next(&hb, step);
+        /* usec_t hb_dt = */ heartbeat_next(&hb, step);
 
         if(unlikely(netdata_exit)) break;