diff options
author | Arne Juul <arnej@yahoo-inc.com> | 2018-10-04 09:00:15 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahoo-inc.com> | 2018-10-05 20:12:44 +0000 |
commit | 6c2a5af5bf087efb126692e69ed973739e0fbafb (patch) | |
tree | cd457b2219ec1cfde5965cb66f9f860cf7858487 /staging_vespalib | |
parent | 8dda354bde1e639d7f481b6895b38460fba3a018 (diff) |
rename MetricName -> MetricId
Diffstat (limited to 'staging_vespalib')
-rw-r--r-- | staging_vespalib/src/tests/metrics/simple_metrics_test.cpp | 2 | ||||
-rw-r--r-- | staging_vespalib/src/vespa/vespalib/metrics/CMakeLists.txt | 2 | ||||
-rw-r--r-- | staging_vespalib/src/vespa/vespalib/metrics/counter.h | 4 | ||||
-rw-r--r-- | staging_vespalib/src/vespa/vespalib/metrics/dummy_metrics_manager.h | 4 | ||||
-rw-r--r-- | staging_vespalib/src/vespa/vespalib/metrics/gauge.h | 4 | ||||
-rw-r--r-- | staging_vespalib/src/vespa/vespalib/metrics/metric_id.cpp (renamed from staging_vespalib/src/vespa/vespalib/metrics/metric_name.cpp) | 2 | ||||
-rw-r--r-- | staging_vespalib/src/vespa/vespalib/metrics/metric_id.h (renamed from staging_vespalib/src/vespa/vespalib/metrics/metric_name.h) | 4 | ||||
-rw-r--r-- | staging_vespalib/src/vespa/vespalib/metrics/metric_point_id.h | 8 | ||||
-rw-r--r-- | staging_vespalib/src/vespa/vespalib/metrics/name_repo.cpp | 6 | ||||
-rw-r--r-- | staging_vespalib/src/vespa/vespalib/metrics/name_repo.h | 6 | ||||
-rw-r--r-- | staging_vespalib/src/vespa/vespalib/metrics/simple_metrics.h | 2 | ||||
-rw-r--r-- | staging_vespalib/src/vespa/vespalib/metrics/simple_metrics_manager.cpp | 8 |
12 files changed, 26 insertions, 26 deletions
diff --git a/staging_vespalib/src/tests/metrics/simple_metrics_test.cpp b/staging_vespalib/src/tests/metrics/simple_metrics_test.cpp index d0163f922b3..7ef57415416 100644 --- a/staging_vespalib/src/tests/metrics/simple_metrics_test.cpp +++ b/staging_vespalib/src/tests/metrics/simple_metrics_test.cpp @@ -15,7 +15,7 @@ using namespace vespalib::metrics; TEST("require that simple metrics gauge merge works") { - MetricIdentifier id(MetricName(42), Point(17)); + MetricPointId id(MetricId(42), Point(17)); Gauge::Measurement a1(id, 0.0); Gauge::Measurement b1(id, 7.0); Gauge::Measurement b2(id, 9.0); diff --git a/staging_vespalib/src/vespa/vespalib/metrics/CMakeLists.txt b/staging_vespalib/src/vespa/vespalib/metrics/CMakeLists.txt index 6da005ffbb7..5112286b359 100644 --- a/staging_vespalib/src/vespa/vespalib/metrics/CMakeLists.txt +++ b/staging_vespalib/src/vespa/vespalib/metrics/CMakeLists.txt @@ -14,7 +14,7 @@ vespa_add_library(staging_vespalib_vespalib_metrics OBJECT json_formatter.cpp label.cpp metric_point_id.cpp - metric_name.cpp + metric_id.cpp metrics_manager.cpp metric_types.cpp name_collection.cpp diff --git a/staging_vespalib/src/vespa/vespalib/metrics/counter.h b/staging_vespalib/src/vespa/vespalib/metrics/counter.h index 680f4a18fb0..192a08aba66 100644 --- a/staging_vespalib/src/vespa/vespalib/metrics/counter.h +++ b/staging_vespalib/src/vespa/vespalib/metrics/counter.h @@ -17,14 +17,14 @@ class CounterAggregator; **/ class Counter { std::shared_ptr<MetricsManager> _manager; - MetricName _id; + MetricId _id; public: Counter() : _manager(), _id(0) {} Counter(const Counter&) = delete; Counter(Counter &&other) = default; Counter& operator= (const Counter &) = delete; Counter& operator= (Counter &&other) = default; - Counter(std::shared_ptr<MetricsManager> m, MetricName id) + Counter(std::shared_ptr<MetricsManager> m, MetricId id) : _manager(std::move(m)), _id(id) {} diff --git a/staging_vespalib/src/vespa/vespalib/metrics/dummy_metrics_manager.h b/staging_vespalib/src/vespa/vespalib/metrics/dummy_metrics_manager.h index 52e9c6a608c..588bc43d83c 100644 --- a/staging_vespalib/src/vespa/vespalib/metrics/dummy_metrics_manager.h +++ b/staging_vespalib/src/vespa/vespalib/metrics/dummy_metrics_manager.h @@ -30,10 +30,10 @@ public: } Counter counter(const vespalib::string &, const vespalib::string &) override { - return Counter(shared_from_this(), MetricName(0)); + return Counter(shared_from_this(), MetricId(0)); } Gauge gauge(const vespalib::string &, const vespalib::string &) override { - return Gauge(shared_from_this(), MetricName(0)); + return Gauge(shared_from_this(), MetricId(0)); } Dimension dimension(const vespalib::string &) override { diff --git a/staging_vespalib/src/vespa/vespalib/metrics/gauge.h b/staging_vespalib/src/vespa/vespalib/metrics/gauge.h index b9702b93089..c4542ac87e4 100644 --- a/staging_vespalib/src/vespa/vespalib/metrics/gauge.h +++ b/staging_vespalib/src/vespa/vespalib/metrics/gauge.h @@ -17,9 +17,9 @@ class GaugeAggregator; class Gauge { private: std::shared_ptr<MetricsManager> _manager; - MetricName _id; + MetricId _id; public: - Gauge(std::shared_ptr<MetricsManager> m, MetricName id) + Gauge(std::shared_ptr<MetricsManager> m, MetricId id) : _manager(std::move(m)), _id(id) {} diff --git a/staging_vespalib/src/vespa/vespalib/metrics/metric_name.cpp b/staging_vespalib/src/vespa/vespalib/metrics/metric_id.cpp index 2a58d55e945..df985db9938 100644 --- a/staging_vespalib/src/vespa/vespalib/metrics/metric_name.cpp +++ b/staging_vespalib/src/vespa/vespalib/metrics/metric_id.cpp @@ -1,2 +1,2 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include "metric_name.h" +#include "metric_id.h" diff --git a/staging_vespalib/src/vespa/vespalib/metrics/metric_name.h b/staging_vespalib/src/vespa/vespalib/metrics/metric_id.h index 60dfa0aa00f..58b401cd552 100644 --- a/staging_vespalib/src/vespa/vespalib/metrics/metric_name.h +++ b/staging_vespalib/src/vespa/vespalib/metrics/metric_id.h @@ -5,11 +5,11 @@ namespace vespalib::metrics { -struct MetricNameTag {}; +struct MetricIdTag {}; /** * Opaque handle representing an uniquely named metric. **/ -using MetricName = Handle<MetricNameTag>; +using MetricId = Handle<MetricIdTag>; } // namespace vespalib::metrics diff --git a/staging_vespalib/src/vespa/vespalib/metrics/metric_point_id.h b/staging_vespalib/src/vespa/vespalib/metrics/metric_point_id.h index 9a709bfb9a6..f9d788a0f92 100644 --- a/staging_vespalib/src/vespa/vespalib/metrics/metric_point_id.h +++ b/staging_vespalib/src/vespa/vespalib/metrics/metric_point_id.h @@ -1,7 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include "metric_name.h" +#include "metric_id.h" #include "point.h" #include <functional> @@ -10,12 +10,12 @@ namespace metrics { /** class to use as a map key, identifying a metric and a point */ struct MetricPointId { - const MetricName _name; + const MetricId _name; const Point _point; MetricPointId() = delete; - MetricPointId(MetricName name, Point point) + MetricPointId(MetricId name, Point point) : _name(name), _point(point) {} bool operator< (const MetricPointId &other) const { @@ -29,7 +29,7 @@ struct MetricPointId { _point == other._point); } - MetricName name() const { return _name; } + MetricId name() const { return _name; } Point point() const { return _point; } }; diff --git a/staging_vespalib/src/vespa/vespalib/metrics/name_repo.cpp b/staging_vespalib/src/vespa/vespalib/metrics/name_repo.cpp index f8294661c77..a47be2f128c 100644 --- a/staging_vespalib/src/vespa/vespalib/metrics/name_repo.cpp +++ b/staging_vespalib/src/vespa/vespalib/metrics/name_repo.cpp @@ -7,12 +7,12 @@ LOG_SETUP(".vespalib.metrics.name_repo"); namespace vespalib { namespace metrics { -MetricName +MetricId NameRepo::metric(const vespalib::string &name) { size_t id = _metricNames.resolve(name); LOG(debug, "metric name %s -> %zu", name.c_str(), id); - return MetricName(id); + return MetricId(id); } Dimension @@ -32,7 +32,7 @@ NameRepo::label(const vespalib::string &value) } const vespalib::string& -NameRepo::metricName(MetricName metric) +NameRepo::metricName(MetricId metric) { return _metricNames.lookup(metric.id()); } diff --git a/staging_vespalib/src/vespa/vespalib/metrics/name_repo.h b/staging_vespalib/src/vespa/vespalib/metrics/name_repo.h index f6972091ff1..b6e643c489e 100644 --- a/staging_vespalib/src/vespa/vespalib/metrics/name_repo.h +++ b/staging_vespalib/src/vespa/vespalib/metrics/name_repo.h @@ -4,7 +4,7 @@ #include <vespa/vespalib/stllike/string.h> #include "dimension.h" #include "label.h" -#include "metric_name.h" +#include "metric_id.h" #include "point.h" #include "name_collection.h" @@ -28,11 +28,11 @@ private: ~NameRepo() = default; public: - MetricName metric(const vespalib::string &name); + MetricId metric(const vespalib::string &name); Dimension dimension(const vespalib::string &name); Label label(const vespalib::string &value); - const vespalib::string& metricName(MetricName metric); + const vespalib::string& metricName(MetricId metric); const vespalib::string& dimensionName(Dimension dim); const vespalib::string& labelValue(Label l); diff --git a/staging_vespalib/src/vespa/vespalib/metrics/simple_metrics.h b/staging_vespalib/src/vespa/vespalib/metrics/simple_metrics.h index 4f9f47f2347..34959146928 100644 --- a/staging_vespalib/src/vespa/vespalib/metrics/simple_metrics.h +++ b/staging_vespalib/src/vespa/vespalib/metrics/simple_metrics.h @@ -14,7 +14,7 @@ #include "json_formatter.h" #include "label.h" #include "metric_point_id.h" -#include "metric_name.h" +#include "metric_id.h" #include "metrics_manager.h" #include "point_builder.h" #include "point.h" diff --git a/staging_vespalib/src/vespa/vespalib/metrics/simple_metrics_manager.cpp b/staging_vespalib/src/vespa/vespalib/metrics/simple_metrics_manager.cpp index 4df44755c0b..46c3f30ea27 100644 --- a/staging_vespalib/src/vespa/vespalib/metrics/simple_metrics_manager.cpp +++ b/staging_vespalib/src/vespa/vespalib/metrics/simple_metrics_manager.cpp @@ -51,7 +51,7 @@ SimpleMetricsManager::createForTest(const SimpleManagerConfig &config, Counter SimpleMetricsManager::counter(const vespalib::string &name, const vespalib::string &) { - MetricName mn = NameRepo::instance.metric(name); + MetricId mn = NameRepo::instance.metric(name); _metricTypes.check(mn.id(), name, MetricTypes::MetricType::COUNTER); LOG(debug, "counter with metric name %s -> %zu", name.c_str(), mn.id()); return Counter(shared_from_this(), mn); @@ -60,7 +60,7 @@ SimpleMetricsManager::counter(const vespalib::string &name, const vespalib::stri Gauge SimpleMetricsManager::gauge(const vespalib::string &name, const vespalib::string &) { - MetricName mn = NameRepo::instance.metric(name); + MetricId mn = NameRepo::instance.metric(name); _metricTypes.check(mn.id(), name, MetricTypes::MetricType::GAUGE); LOG(debug, "gauge with metric name %s -> %zu", name.c_str(), mn.id()); return Gauge(shared_from_this(), mn); @@ -118,14 +118,14 @@ SimpleMetricsManager::snapshotFrom(const Bucket &bucket) } } for (const CounterAggregator& entry : bucket.counters) { - MetricName mn = entry.idx.name(); + MetricId mn = entry.idx.name(); size_t pi = entry.idx.point().id(); const vespalib::string &name = NameRepo::instance.metricName(mn); CounterSnapshot val(name, snap.points()[pi], entry); snap.add(val); } for (const GaugeAggregator& entry : bucket.gauges) { - MetricName mn = entry.idx.name(); + MetricId mn = entry.idx.name(); size_t pi = entry.idx.point().id(); const vespalib::string &name = NameRepo::instance.metricName(mn); GaugeSnapshot val(name, snap.points()[pi], entry); |