diff options
author | Costa Tsaousis <costa@tsaousis.gr> | 2018-10-27 23:54:25 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-27 23:54:25 +0300 |
commit | fdae392242b6edf50500a7027239267b82414050 (patch) | |
tree | 1ce19f8c2413d706d9b77fd82e06a16072caa94f /streaming/rrdpush.c | |
parent | 4014937a77230ab99c5c8148c13b404c02330387 (diff) |
do not send duplicate chart names (#4508)
Diffstat (limited to 'streaming/rrdpush.c')
-rw-r--r-- | streaming/rrdpush.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/streaming/rrdpush.c b/streaming/rrdpush.c index 1b48ad9a1f..df1a2177f8 100644 --- a/streaming/rrdpush.c +++ b/streaming/rrdpush.c @@ -149,12 +149,25 @@ static inline void rrdpush_send_chart_definition_nolock(RRDSET *st) { rrdset_flag_set(st, RRDSET_FLAG_UPSTREAM_EXPOSED); + // properly set the name for the remote end to parse it + char *name = ""; + if(unlikely(strcmp(st->id, st->name))) { + // they differ + name = strchr(st->name, '.'); + if(name) + name++; + else + name = ""; + } + + // info("CHART '%s' '%s'", st->id, name); + // send the chart buffer_sprintf( host->rrdpush_sender_buffer , "CHART \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" %ld %d \"%s %s %s %s\" \"%s\" \"%s\"\n" , st->id - , st->name + , name , st->title , st->units , st->family |