teach influxpusher that nullptr fields can be ignored - good to programatically not send out some data
parent
2400a166f0
commit
c5a96a3e11
|
@ -40,6 +40,8 @@ void InfluxPusher::addValueObserver(int src, string_view name, const initializer
|
||||||
buffer+= " ";
|
buffer+= " ";
|
||||||
bool lefirst=true;
|
bool lefirst=true;
|
||||||
for(const auto& v : values) {
|
for(const auto& v : values) {
|
||||||
|
if(!v.first) // trick to null out certain fields
|
||||||
|
continue;
|
||||||
d_numvalues++;
|
d_numvalues++;
|
||||||
if(!lefirst) {
|
if(!lefirst) {
|
||||||
buffer +=",";
|
buffer +=",";
|
||||||
|
@ -102,6 +104,9 @@ void InfluxPusher::addValue(const vector<pair<string,var_t>>& tags, string_view
|
||||||
buffer+= " ";
|
buffer+= " ";
|
||||||
bool lefirst=true;
|
bool lefirst=true;
|
||||||
for(const auto& v : values) {
|
for(const auto& v : values) {
|
||||||
|
if(!v.first) // trick to null out certain fields
|
||||||
|
continue;
|
||||||
|
|
||||||
d_numvalues++;
|
d_numvalues++;
|
||||||
if(!lefirst) {
|
if(!lefirst) {
|
||||||
buffer +=",";
|
buffer +=",";
|
||||||
|
|
Loading…
Reference in New Issue