]> git.sesse.net Git - nageru/blobdiff - metrics.cpp
Streamline the metrics member function names a bit.
[nageru] / metrics.cpp
index 7adcc98299ac40d63600cab51fa3b93090e23827..b721214a1ba3117f31ed06a07e8acbb4c8dec93d 100644 (file)
@@ -7,13 +7,13 @@ using namespace std;
 
 Metrics global_metrics;
 
-void Metrics::register_int_metric(const string &name, atomic<int64_t> *location, Metrics::Type type)
+void Metrics::add(const string &name, atomic<int64_t> *location, Metrics::Type type)
 {
        lock_guard<mutex> lock(mu);
        int_metrics.emplace(name, Metric<int64_t>{ type, location });
 }
 
-void Metrics::register_double_metric(const string &name, atomic<double> *location, Metrics::Type type)
+void Metrics::add(const string &name, atomic<double> *location, Metrics::Type type)
 {
        lock_guard<mutex> lock(mu);
        double_metrics.emplace(name, Metric<double>{ 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";