summaryrefslogtreecommitdiffstats
path: root/staging_vespalib
diff options
context:
space:
mode:
authorArne Juul <arnej@yahoo-inc.com>2018-10-04 08:58:31 +0000
committerArne Juul <arnej@yahoo-inc.com>2018-10-05 20:12:44 +0000
commit8dda354bde1e639d7f481b6895b38460fba3a018 (patch)
treeac78e5d59d236ce96efa4cb6564b8d94a13dd804 /staging_vespalib
parentff6fc885e081eb0d8bbfd7ffd57cdfbe95a6300f (diff)
rename MetricIdentifier -> MetricPointId
Diffstat (limited to 'staging_vespalib')
-rw-r--r--staging_vespalib/src/vespa/vespalib/metrics/CMakeLists.txt2
-rw-r--r--staging_vespalib/src/vespa/vespalib/metrics/bucket.cpp4
-rw-r--r--staging_vespalib/src/vespa/vespalib/metrics/bucket.h2
-rw-r--r--staging_vespalib/src/vespa/vespalib/metrics/counter.cpp2
-rw-r--r--staging_vespalib/src/vespa/vespalib/metrics/counter.h6
-rw-r--r--staging_vespalib/src/vespa/vespalib/metrics/counter_aggregator.h4
-rw-r--r--staging_vespalib/src/vespa/vespalib/metrics/gauge.cpp2
-rw-r--r--staging_vespalib/src/vespa/vespalib/metrics/gauge.h6
-rw-r--r--staging_vespalib/src/vespa/vespalib/metrics/gauge_aggregator.h4
-rw-r--r--staging_vespalib/src/vespa/vespalib/metrics/metric_point_id.cpp (renamed from staging_vespalib/src/vespa/vespalib/metrics/metric_identifier.cpp)2
-rw-r--r--staging_vespalib/src/vespa/vespalib/metrics/metric_point_id.h (renamed from staging_vespalib/src/vespa/vespalib/metrics/metric_identifier.h)12
-rw-r--r--staging_vespalib/src/vespa/vespalib/metrics/simple_metrics.h2
12 files changed, 24 insertions, 24 deletions
diff --git a/staging_vespalib/src/vespa/vespalib/metrics/CMakeLists.txt b/staging_vespalib/src/vespa/vespalib/metrics/CMakeLists.txt
index 4a28734b85d..6da005ffbb7 100644
--- a/staging_vespalib/src/vespa/vespalib/metrics/CMakeLists.txt
+++ b/staging_vespalib/src/vespa/vespalib/metrics/CMakeLists.txt
@@ -13,7 +13,7 @@ vespa_add_library(staging_vespalib_vespalib_metrics OBJECT
handle.cpp
json_formatter.cpp
label.cpp
- metric_identifier.cpp
+ metric_point_id.cpp
metric_name.cpp
metrics_manager.cpp
metric_types.cpp
diff --git a/staging_vespalib/src/vespa/vespalib/metrics/bucket.cpp b/staging_vespalib/src/vespa/vespalib/metrics/bucket.cpp
index 52e95e1ac3f..af942a48fb9 100644
--- a/staging_vespalib/src/vespa/vespalib/metrics/bucket.cpp
+++ b/staging_vespalib/src/vespa/vespalib/metrics/bucket.cpp
@@ -14,12 +14,12 @@ mergeFromSamples(const StableStore<typename T::sample_type> &source)
{
using Aggregator = typename T::aggregator_type;
using Sample = typename T::sample_type;
- using Map = std::map<MetricIdentifier, Aggregator>;
+ using Map = std::map<MetricPointId, Aggregator>;
using MapValue = typename Map::value_type;
Map map;
source.for_each([&map] (const Sample &sample) {
- MetricIdentifier id = sample.idx;
+ MetricPointId id = sample.idx;
auto iter_check = map.emplace(id, sample);
if (!iter_check.second) {
iter_check.first->second.merge(sample);
diff --git a/staging_vespalib/src/vespa/vespalib/metrics/bucket.h b/staging_vespalib/src/vespa/vespalib/metrics/bucket.h
index 5a88e435502..e358080b73b 100644
--- a/staging_vespalib/src/vespa/vespalib/metrics/bucket.h
+++ b/staging_vespalib/src/vespa/vespalib/metrics/bucket.h
@@ -3,7 +3,7 @@
#include <mutex>
#include "stable_store.h"
-#include "metric_identifier.h"
+#include "metric_point_id.h"
#include "counter.h"
#include "gauge.h"
#include "clock.h"
diff --git a/staging_vespalib/src/vespa/vespalib/metrics/counter.cpp b/staging_vespalib/src/vespa/vespalib/metrics/counter.cpp
index 08f72e6aa34..c04a21a0020 100644
--- a/staging_vespalib/src/vespa/vespalib/metrics/counter.cpp
+++ b/staging_vespalib/src/vespa/vespalib/metrics/counter.cpp
@@ -10,7 +10,7 @@ void
Counter::add(size_t count, Point point) const
{
if (_manager) {
- MetricIdentifier fullId(_id, point);
+ MetricPointId fullId(_id, point);
_manager->add(Increment(fullId, count));
}
}
diff --git a/staging_vespalib/src/vespa/vespalib/metrics/counter.h b/staging_vespalib/src/vespa/vespalib/metrics/counter.h
index 36a25adda2d..680f4a18fb0 100644
--- a/staging_vespalib/src/vespa/vespalib/metrics/counter.h
+++ b/staging_vespalib/src/vespa/vespalib/metrics/counter.h
@@ -2,7 +2,7 @@
#pragma once
#include <memory>
-#include "metric_identifier.h"
+#include "metric_point_id.h"
#include "point.h"
namespace vespalib {
@@ -42,10 +42,10 @@ public:
// internal
struct Increment {
- MetricIdentifier idx;
+ MetricPointId idx;
size_t value;
Increment() = delete;
- Increment(MetricIdentifier id, size_t v) : idx(id), value(v) {}
+ Increment(MetricPointId id, size_t v) : idx(id), value(v) {}
};
typedef CounterAggregator aggregator_type;
diff --git a/staging_vespalib/src/vespa/vespalib/metrics/counter_aggregator.h b/staging_vespalib/src/vespa/vespalib/metrics/counter_aggregator.h
index 995ba07deb3..e7f9ab1c9ab 100644
--- a/staging_vespalib/src/vespa/vespalib/metrics/counter_aggregator.h
+++ b/staging_vespalib/src/vespa/vespalib/metrics/counter_aggregator.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_identifier.h"
+#include "metric_point_id.h"
#include "counter.h"
namespace vespalib {
@@ -9,7 +9,7 @@ namespace metrics {
// internal
struct CounterAggregator {
- MetricIdentifier idx;
+ MetricPointId idx;
size_t count;
CounterAggregator(const Counter::Increment &other);
diff --git a/staging_vespalib/src/vespa/vespalib/metrics/gauge.cpp b/staging_vespalib/src/vespa/vespalib/metrics/gauge.cpp
index af98ba2de18..f2afc87f16f 100644
--- a/staging_vespalib/src/vespa/vespalib/metrics/gauge.cpp
+++ b/staging_vespalib/src/vespa/vespalib/metrics/gauge.cpp
@@ -9,7 +9,7 @@ void
Gauge::sample(double value, Point point) const
{
if (_manager) {
- MetricIdentifier fullId(_id, point);
+ MetricPointId fullId(_id, point);
_manager->sample(Measurement(fullId, value));
}
}
diff --git a/staging_vespalib/src/vespa/vespalib/metrics/gauge.h b/staging_vespalib/src/vespa/vespalib/metrics/gauge.h
index fa3f826f2b8..b9702b93089 100644
--- a/staging_vespalib/src/vespa/vespalib/metrics/gauge.h
+++ b/staging_vespalib/src/vespa/vespalib/metrics/gauge.h
@@ -2,7 +2,7 @@
#pragma once
#include <memory>
-#include "metric_identifier.h"
+#include "metric_point_id.h"
#include "point.h"
namespace vespalib {
@@ -32,10 +32,10 @@ public:
// internal
struct Measurement {
- MetricIdentifier idx;
+ MetricPointId idx;
double value;
Measurement() = delete;
- Measurement(MetricIdentifier id, double v) : idx(id), value(v) {}
+ Measurement(MetricPointId id, double v) : idx(id), value(v) {}
};
typedef GaugeAggregator aggregator_type;
diff --git a/staging_vespalib/src/vespa/vespalib/metrics/gauge_aggregator.h b/staging_vespalib/src/vespa/vespalib/metrics/gauge_aggregator.h
index 84772d7fff4..ae3365bc7f0 100644
--- a/staging_vespalib/src/vespa/vespalib/metrics/gauge_aggregator.h
+++ b/staging_vespalib/src/vespa/vespalib/metrics/gauge_aggregator.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_identifier.h"
+#include "metric_point_id.h"
#include "gauge.h"
namespace vespalib {
@@ -9,7 +9,7 @@ namespace metrics {
// internal
struct GaugeAggregator {
- MetricIdentifier idx;
+ MetricPointId idx;
size_t observedCount;
double sumValue;
double minValue;
diff --git a/staging_vespalib/src/vespa/vespalib/metrics/metric_identifier.cpp b/staging_vespalib/src/vespa/vespalib/metrics/metric_point_id.cpp
index 950adc3462d..90ecabdb75f 100644
--- a/staging_vespalib/src/vespa/vespalib/metrics/metric_identifier.cpp
+++ b/staging_vespalib/src/vespa/vespalib/metrics/metric_point_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_identifier.h"
+#include "metric_point_id.h"
diff --git a/staging_vespalib/src/vespa/vespalib/metrics/metric_identifier.h b/staging_vespalib/src/vespa/vespalib/metrics/metric_point_id.h
index 0fc5af41a81..9a709bfb9a6 100644
--- a/staging_vespalib/src/vespa/vespalib/metrics/metric_identifier.h
+++ b/staging_vespalib/src/vespa/vespalib/metrics/metric_point_id.h
@@ -8,23 +8,23 @@
namespace vespalib {
namespace metrics {
-// internal
-struct MetricIdentifier {
+/** class to use as a map key, identifying a metric and a point */
+struct MetricPointId {
const MetricName _name;
const Point _point;
- MetricIdentifier() = delete;
+ MetricPointId() = delete;
- MetricIdentifier(MetricName name, Point point)
+ MetricPointId(MetricName name, Point point)
: _name(name), _point(point) {}
- bool operator< (const MetricIdentifier &other) const {
+ bool operator< (const MetricPointId &other) const {
if (_name != other._name) {
return _name < other._name;
}
return _point < other._point;
}
- bool operator== (const MetricIdentifier &other) const {
+ bool operator== (const MetricPointId &other) const {
return (_name == other._name &&
_point == other._point);
}
diff --git a/staging_vespalib/src/vespa/vespalib/metrics/simple_metrics.h b/staging_vespalib/src/vespa/vespalib/metrics/simple_metrics.h
index 6e6cff55b1f..4f9f47f2347 100644
--- a/staging_vespalib/src/vespa/vespalib/metrics/simple_metrics.h
+++ b/staging_vespalib/src/vespa/vespalib/metrics/simple_metrics.h
@@ -13,7 +13,7 @@
#include "gauge.h"
#include "json_formatter.h"
#include "label.h"
-#include "metric_identifier.h"
+#include "metric_point_id.h"
#include "metric_name.h"
#include "metrics_manager.h"
#include "point_builder.h"