X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=metrics.cpp;fp=metrics.cpp;h=b721214a1ba3117f31ed06a07e8acbb4c8dec93d;hb=58bcd6473f3153a54672a6af98d56e02d558ceb6;hp=7adcc98299ac40d63600cab51fa3b93090e23827;hpb=17604ff6206c34326111ef2003073e1f0de28823;p=nageru diff --git a/metrics.cpp b/metrics.cpp index 7adcc98..b721214 100644 --- a/metrics.cpp +++ b/metrics.cpp @@ -7,13 +7,13 @@ using namespace std; Metrics global_metrics; -void Metrics::register_int_metric(const string &name, atomic *location, Metrics::Type type) +void Metrics::add(const string &name, atomic *location, Metrics::Type type) { lock_guard lock(mu); int_metrics.emplace(name, Metric{ type, location }); } -void Metrics::register_double_metric(const string &name, atomic *location, Metrics::Type type) +void Metrics::add(const string &name, atomic *location, Metrics::Type type) { lock_guard lock(mu); double_metrics.emplace(name, Metric{ type, location }); @@ -32,8 +32,8 @@ string Metrics::serialize() const ss << "nageru_" << key_and_value.first << " " << key_and_value.second.location->load() << "\n"; } - ss.precision(20); - ss << scientific; +// ss.precision(20); +// ss << scientific; for (const auto &key_and_value : double_metrics) { if (key_and_value.second.type == TYPE_GAUGE) { ss << "# TYPE nageru_" << key_and_value.first << " gauge\n";