From c5a96a3e1163d25c24d15087ecfdb915293847be Mon Sep 17 00:00:00 2001 From: bert hubert Date: Thu, 9 Jul 2020 21:46:56 +0200 Subject: [PATCH] teach influxpusher that nullptr fields can be ignored - good to programatically not send out some data --- influxpush.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/influxpush.cc b/influxpush.cc index c5c298c..ead9914 100644 --- a/influxpush.cc +++ b/influxpush.cc @@ -40,6 +40,8 @@ void InfluxPusher::addValueObserver(int src, string_view name, const initializer buffer+= " "; bool lefirst=true; for(const auto& v : values) { + if(!v.first) // trick to null out certain fields + continue; d_numvalues++; if(!lefirst) { buffer +=","; @@ -102,6 +104,9 @@ void InfluxPusher::addValue(const vector>& tags, string_view buffer+= " "; bool lefirst=true; for(const auto& v : values) { + if(!v.first) // trick to null out certain fields + continue; + d_numvalues++; if(!lefirst) { buffer +=",";