Skip to content

Commit 4111977

Browse files
committed
InfluxDB backend: added integer values suffix
1 parent 11e1377 commit 4111977

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

examples/1-Basic.cxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ int main(int argc, char *argv[]) {
1818
// myMetric is the name of the metric
1919
//
2020
// 1. by copying values
21-
Monitoring::Get().send(10, "myMetric");
21+
Monitoring::Get().send(10, "myMetricInt");
22+
Monitoring::Get().send(10.10, "myMetricFloat");
2223

2324
// 2. by creating and moving metric object
24-
Monitoring::Get().send({10, "myMetric"});
25+
Monitoring::Get().send({10, "myMetricInt"});
26+
Monitoring::Get().send({10.10, "myMetricFloat"});
2527
}

src/Backends/InfluxDB.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ void InfluxDB::send(const Metric& metric)
6262
value.insert(value.begin(), '"');
6363
value.insert(value.end(), '"');
6464
}
65+
66+
if (metric.getType() == MetricType::INT) {
67+
value.insert(value.end(), 'i');
68+
}
6569
std::string name = metric.getName();
6670
escape(name);
6771

0 commit comments

Comments
 (0)