summaryrefslogtreecommitdiffstats
path: root/streaming
diff options
context:
space:
mode:
authorEmmanuel Vasilakis <mrzammler@mm.st>2022-10-13 11:21:23 +0300
committerGitHub <noreply@github.com>2022-10-13 11:21:23 +0300
commitfb86ddd70d14f7943e0314b02235ce3cbca5cb2d (patch)
tree4bf1ad1646573361dcf3f87cfb6522e3a0f76266 /streaming
parent61767a8a08d089962ff82e45b3e459c8bd05b0c4 (diff)
Count currently streaming senders on the localhost (#13755)
rebased
Diffstat (limited to 'streaming')
-rw-r--r--streaming/receiver.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/streaming/receiver.c b/streaming/receiver.c
index 45483285c7..9d4f319462 100644
--- a/streaming/receiver.c
+++ b/streaming/receiver.c
@@ -744,6 +744,7 @@ static int rrdpush_receive(struct receiver_state *rpt)
rpt->host->senders_connect_time = now_realtime_sec();
rpt->host->senders_last_chart_command = 0;
rpt->host->trigger_chart_obsoletion_check = 1;
+
rrdhost_unlock(rpt->host);
// call the plugins.d processor to receive the metrics
@@ -759,6 +760,8 @@ static int rrdpush_receive(struct receiver_state *rpt)
aclk_host_state_update(rpt->host, 1);
#endif
+ rrdhost_set_is_parent_label(++localhost->senders_count);
+
rrdcontext_host_child_connected(rpt->host);
size_t count = streaming_parser(rpt, &cd, fp_in, fp_out);
@@ -772,11 +775,13 @@ static int rrdpush_receive(struct receiver_state *rpt)
#ifdef ENABLE_ACLK
// in case we have cloud connection we inform cloud
- // new child connected
+ // a child disconnected
if (netdata_cloud_setting)
aclk_host_state_update(rpt->host, 0);
#endif
+ rrdhost_set_is_parent_label(--localhost->senders_count);
+
// During a shutdown there is cleanup code in rrdhost that will cancel the sender thread
if (!netdata_exit && rpt->host) {
rrd_rdlock();