aboutsummaryrefslogtreecommitdiffstats
path: root/metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/Metrics.java
diff options
context:
space:
mode:
Diffstat (limited to 'metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/Metrics.java')
-rw-r--r--metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/Metrics.java30
1 files changed, 3 insertions, 27 deletions
diff --git a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/Metrics.java b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/Metrics.java
index 571ffc030de..8450d9f6be7 100644
--- a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/Metrics.java
+++ b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/Metrics.java
@@ -1,16 +1,12 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package ai.vespa.metricsproxy.metric;
-import ai.vespa.metricsproxy.metric.model.MetricId;
-
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* Once a getter is called, the instance is frozen and no more metrics can be added.
- *
- * @author Unknown
*/
// TODO: remove timestamp, only used as temporary storage.
// TODO: instances of this class can probably be replaced by a simple freezable map.
@@ -52,37 +48,17 @@ public class Metrics {
this.metrics.add(m);
}
- /**
- * Get the size of the metrics covered. Note that this might also contain expired metrics
- *
- * @return size of metrics
- */
+ /** Returns the size of the metrics covered. Note that this might also contain expired metrics. */
public int size() {
return this.metrics.size();
}
- /**
- * TODO: Remove, might be multiple metrics with same name but different dimensions
- *
- * @param key metric name
- * @return the metric, or null
- */
- public Metric getMetric(MetricId key) {
- isFrozen = true;
- for (Metric m: metrics) {
- if (m.getName().equals(key)) {
- return m;
- }
- }
- return null;
- }
-
- public List<Metric> getMetrics() {
+ public List<Metric> list() {
isFrozen = true;
return Collections.unmodifiableList(metrics);
}
-
+ @Override
public String toString() {
StringBuilder sb = new StringBuilder();
for (Metric m : metrics) {