diff options
author | Austin S. Hemmelgarn <austin@netdata.cloud> | 2020-04-13 08:39:52 -0400 |
---|---|---|
committer | Austin S. Hemmelgarn <austin@netdata.cloud> | 2020-04-13 08:42:22 -0400 |
commit | e2874320fc027f7ab51ab3e115d5b1889b8fd747 (patch) | |
tree | cd755ef9b8522634c61aed9888239c9b67394157 /exporting/send_data.c | |
parent | 353780082c0ac8525e5b52aa8a29bbf5b70871e8 (diff) |
Revert changes since v1.21 in pereparation for hotfix release.
Diffstat (limited to 'exporting/send_data.c')
-rw-r--r-- | exporting/send_data.c | 50 |
1 files changed, 9 insertions, 41 deletions
diff --git a/exporting/send_data.c b/exporting/send_data.c index 8875065f2b..6315a7d1bf 100644 --- a/exporting/send_data.c +++ b/exporting/send_data.c @@ -57,8 +57,8 @@ void simple_connector_receive_response(int *sock, struct instance *instance) if (likely(r > 0)) { // we received some data response->len += r; - stats->received_bytes += r; - stats->receptions++; + stats->chart_received_bytes += r; + stats->chart_receptions++; } else if (r == 0) { error("EXPORTING: '%s' closed the socket", instance->config.destination); close(*sock); @@ -109,9 +109,9 @@ void simple_connector_send_buffer(int *sock, int *failures, struct instance *ins if(written != -1 && (size_t)written == len) { // we sent the data successfully - stats->transmission_successes++; - stats->sent_bytes += written; - stats->sent_metrics = stats->buffered_metrics; + stats->chart_transmission_successes++; + stats->chart_sent_bytes += written; + stats->chart_sent_metrics = stats->chart_buffered_metrics; // reset the failures count *failures = 0; @@ -126,10 +126,10 @@ void simple_connector_send_buffer(int *sock, int *failures, struct instance *ins instance->config.destination, len, written); - stats->transmission_failures++; + stats->chart_transmission_failures++; if(written != -1) - stats->sent_bytes += written; + stats->chart_sent_bytes += written; // increment the counter we check for data loss (*failures)++; @@ -160,19 +160,6 @@ void simple_connector_worker(void *instance_p) int failures = 0; while(!netdata_exit) { - - // reset the monitoring chart counters - stats->received_bytes = - stats->sent_bytes = - stats->sent_metrics = - stats->lost_metrics = - stats->receptions = - stats->transmission_successes = - stats->transmission_failures = - stats->data_lost_events = - stats->lost_bytes = - stats->reconnects = 0; - // ------------------------------------------------------------------------ // if we are connected, receive a response, without blocking @@ -192,7 +179,7 @@ void simple_connector_worker(void *instance_p) &reconnects, NULL, 0); - stats->reconnects += reconnects; + stats->chart_reconnects += reconnects; } if(unlikely(netdata_exit)) break; @@ -207,31 +194,12 @@ void simple_connector_worker(void *instance_p) simple_connector_send_buffer(&sock, &failures, instance); } else { error("EXPORTING: failed to update '%s'", instance->config.destination); - stats->transmission_failures++; + stats->chart_transmission_failures++; // increment the counter we check for data loss failures++; } - BUFFER *buffer = instance->buffer; - - if (failures > instance->config.buffer_on_failures) { - stats->lost_bytes += buffer_strlen(buffer); - error( - "EXPORTING: connector instance %s reached %d exporting failures. " - "Flushing buffers to protect this host - this results in data loss on server '%s'", - instance->config.name, failures, instance->config.destination); - buffer_flush(buffer); - failures = 0; - stats->data_lost_events++; - stats->lost_metrics = stats->buffered_metrics; - } - - send_internal_metrics(instance); - - if(likely(buffer_strlen(buffer) == 0)) - stats->buffered_metrics = 0; - uv_mutex_unlock(&instance->mutex); #ifdef UNIT_TESTING |