@cryptotaxi247 / netdata-1 / commits / 3edd4667d

backend buffer should always be incremental

Costa Tsaousis (ktsaou) committed Jan 28, 2017 at 18:45 UTC 3edd4667dd94869de55ab213d93e3886ab8cf3cf
2 files changed +5 -7
src/backends.c
+4 -6
@@ -349,6 +349,10 @@ void *backends_main(void *ptr) {
349 //fprintf(stderr, "\nBACKEND BEGIN:\n%s\nBACKEND END\n", buffer_tostring(b)); // FIXME
350 //fprintf(stderr, "after = %lu, before = %lu\n", after, before);
351
352 + // prepare for the next iteration
353 + // to add incrementally data to buffer
354 + after = before;
355 +
356 // ------------------------------------------------------------------------
357 // if we are connected, receive a response, without blocking
358
@@ -454,12 +458,6 @@ void *backends_main(void *ptr) {
458 close(sock);
459 sock = -1;
460 }
457 -
458 - // either the buffer is empty
459 - // or is holding the data we couldn't send
460 - // so, make sure the next iteration will continue
461 - // from where we are now
462 - after = before;
461 }
462 else {
463 error("Failed to update database backend '%s'", destination);
src/plugin_proc_diskspace.c
+1 -1
@@ -237,7 +237,7 @@ void *proc_diskspace_main(void *ptr) {
237 heartbeat_init(&hb);
238 for(;;) {
239 duration = heartbeat_dt_usec(&hb);
240 - usec_t hb_dt = heartbeat_next(&hb, step);
240 + /* usec_t hb_dt = */ heartbeat_next(&hb, step);
241
242 if(unlikely(netdata_exit)) break;
243