Skip to content

Commit

Permalink
teach influxpusher that nullptr fields can be ignored - good to progr…
Browse files Browse the repository at this point in the history
…amatically not send out some data
  • Loading branch information
ahupowerdns committed Jul 9, 2020
1 parent 2400a16 commit c5a96a3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions influxpush.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 +=",";
Expand Down Expand Up @@ -102,6 +104,9 @@ void InfluxPusher::addValue(const vector<pair<string,var_t>>& 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 +=",";
Expand Down

0 comments on commit c5a96a3

Please sign in to comment.