diff options
author | Jon Bratseth <bratseth@gmail.com> | 2023-03-06 18:32:07 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2023-03-06 18:32:07 +0100 |
commit | fb7acdeb14c60ef30bea0bc93460befc9c85bc73 (patch) | |
tree | 429b4cdf1fafeeb5629c4b3a89088b33e07e9617 | |
parent | f43a8997080ceb4dc4c39a512178d22093253479 (diff) |
Use metric enums everywhere
3 files changed, 31 insertions, 23 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/admin/monitoring/AutoscalingMetrics.java b/config-model/src/main/java/com/yahoo/vespa/model/admin/monitoring/AutoscalingMetrics.java index fb57774e0cf..29a54548256 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/admin/monitoring/AutoscalingMetrics.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/admin/monitoring/AutoscalingMetrics.java @@ -26,25 +26,26 @@ public class AutoscalingMetrics { // Memory util metrics.add(HostedNodeAdminMetrics.MEM_UTIL.baseName()); // node level - default - metrics.add(SearchNodeMetrics.CONTENT_PROTON_RESOURCE_USAGE_MEMORY.average()); // better for content as it is the basis for blocking + metrics.add(SearchNodeMetrics.CONTENT_PROTON_RESOURCE_USAGE_MEMORY.average()); // the basis for blocking // Disk util metrics.add(HostedNodeAdminMetrics.DISK_UTIL.baseName()); // node level -default - metrics.add(SearchNodeMetrics.CONTENT_PROTON_RESOURCE_USAGE_DISK.average()); // better for content as it is the basis for blocking + metrics.add(SearchNodeMetrics.CONTENT_PROTON_RESOURCE_USAGE_DISK.average()); // the basis for blocking metrics.add(ContainerMetrics.APPLICATION_GENERATION.last()); + metrics.add(SearchNodeMetrics.CONTENT_PROTON_CONFIG_GENERATION.last()); metrics.add(ContainerMetrics.IN_SERVICE.last()); // Query rate - metrics.add(ContainerMetrics.QUERIES.rate()); // container - metrics.add(SearchNodeMetrics.CONTENT_PROTON_DOCUMENTDB_MATCHING_QUERIES.rate()); // content + metrics.add(ContainerMetrics.QUERIES.rate()); + metrics.add(SearchNodeMetrics.CONTENT_PROTON_DOCUMENTDB_MATCHING_QUERIES.rate()); // Write rate - metrics.add(ContainerMetrics.FEED_HTTP_REQUESTS.rate()); // container - metrics.add(StorageMetrics.VDS_FILESTOR_ALLTHREADS_PUT_COUNT.rate()); // content - metrics.add(StorageMetrics.VDS_FILESTOR_ALLTHREADS_REMOVE_COUNT.rate()); // content - metrics.add(StorageMetrics.VDS_FILESTOR_ALLTHREADS_UPDATE_COUNT.rate()); // content + metrics.add(ContainerMetrics.FEED_HTTP_REQUESTS.rate()); + metrics.add(StorageMetrics.VDS_FILESTOR_ALLTHREADS_PUT_COUNT.rate()); + metrics.add(StorageMetrics.VDS_FILESTOR_ALLTHREADS_REMOVE_COUNT.rate()); + metrics.add(StorageMetrics.VDS_FILESTOR_ALLTHREADS_UPDATE_COUNT.rate()); return new MetricSet("autoscaling", toMetrics(metrics)); } diff --git a/linguistics/src/main/java/com/yahoo/language/Linguistics.java b/linguistics/src/main/java/com/yahoo/language/Linguistics.java index 791bc5dabcf..6fa63e657bd 100644 --- a/linguistics/src/main/java/com/yahoo/language/Linguistics.java +++ b/linguistics/src/main/java/com/yahoo/language/Linguistics.java @@ -47,7 +47,7 @@ public interface Linguistics { /** * Returns a thread-unsafe tokenizer. - * This is used at indexing time to produce a optionally stemmed and + * This is used at indexing time to produce an optionally stemmed and * transformed (accent normalized) stream of indexable tokens. */ Tokenizer getTokenizer(); diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/MetricsResponse.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/MetricsResponse.java index 84988be99ec..8b7a2bafc40 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/MetricsResponse.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/MetricsResponse.java @@ -4,6 +4,10 @@ package com.yahoo.vespa.hosted.provision.autoscale; import com.yahoo.collections.ListMap; import com.yahoo.collections.Pair; import com.yahoo.config.provision.ClusterSpec; +import com.yahoo.metrics.ContainerMetrics; +import com.yahoo.metrics.HostedNodeAdminMetrics; +import com.yahoo.metrics.SearchNodeMetrics; +import com.yahoo.metrics.StorageMetrics; import com.yahoo.slime.ArrayTraverser; import com.yahoo.slime.Inspector; import com.yahoo.slime.ObjectTraverser; @@ -116,7 +120,7 @@ public class MetricsResponse { cpu { // a node resource @Override - public List<String> metricResponseNames() { return List.of("cpu.util"); } + public List<String> metricResponseNames() { return List.of(HostedNodeAdminMetrics.CPU_UTIL.baseName()); } @Override double computeFinal(ListMap<String, Double> values) { @@ -128,15 +132,16 @@ public class MetricsResponse { @Override public List<String> metricResponseNames() { - return List.of("content.proton.resource_usage.memory.average", "mem.util"); + return List.of(HostedNodeAdminMetrics.MEM_UTIL.baseName(), + SearchNodeMetrics.CONTENT_PROTON_RESOURCE_USAGE_MEMORY.average()); } @Override double computeFinal(ListMap<String, Double> values) { - var valueList = values.get("content.proton.resource_usage.memory.average"); // prefer over mem.util + var valueList = values.get(SearchNodeMetrics.CONTENT_PROTON_RESOURCE_USAGE_MEMORY.average()); // prefer over mem.util if ( ! valueList.isEmpty()) return valueList.get(0); - valueList = values.get("mem.util"); + valueList = values.get(HostedNodeAdminMetrics.MEM_UTIL.baseName()); if ( ! valueList.isEmpty()) return valueList.get(0) / 100; // % to ratio return 0; @@ -147,15 +152,16 @@ public class MetricsResponse { @Override public List<String> metricResponseNames() { - return List.of("content.proton.resource_usage.disk.average", "disk.util"); + return List.of(HostedNodeAdminMetrics.DISK_UTIL.baseName(), + SearchNodeMetrics.CONTENT_PROTON_RESOURCE_USAGE_DISK.average()); } @Override double computeFinal(ListMap<String, Double> values) { - var valueList = values.get("content.proton.resource_usage.disk.average"); // prefer over mem.util + var valueList = values.get(SearchNodeMetrics.CONTENT_PROTON_RESOURCE_USAGE_DISK.average()); // prefer over mem.util if ( ! valueList.isEmpty()) return valueList.get(0); - valueList = values.get("disk.util"); + valueList = values.get(HostedNodeAdminMetrics.DISK_UTIL.baseName()); if ( ! valueList.isEmpty()) return valueList.get(0) / 100; // % to ratio return 0; @@ -166,7 +172,7 @@ public class MetricsResponse { @Override public List<String> metricResponseNames() { - return List.of(APPLICATION_GENERATION.last() /*, "content.proton.config.generation" */); + return List.of(APPLICATION_GENERATION.last(), SearchNodeMetrics.CONTENT_PROTON_CONFIG_GENERATION.last()); } @Override @@ -191,8 +197,8 @@ public class MetricsResponse { @Override public List<String> metricResponseNames() { - return List.of("queries.rate", - "content.proton.documentdb.matching.queries.rate"); + return List.of(ContainerMetrics.QUERIES.rate(), + SearchNodeMetrics.CONTENT_PROTON_DOCUMENTDB_MATCHING_QUERIES.rate()); } }, @@ -200,10 +206,11 @@ public class MetricsResponse { @Override public List<String> metricResponseNames() { - return List.of("feed.http-requests.rate", - "vds.filestor.allthreads.put.count.rate", - "vds.filestor.allthreads.remove.count.rate", - "vds.filestor.allthreads.update.count.rate"); } + return List.of(ContainerMetrics.FEED_HTTP_REQUESTS.rate(), + StorageMetrics.VDS_FILESTOR_ALLTHREADS_PUT_COUNT.rate(), + StorageMetrics.VDS_FILESTOR_ALLTHREADS_REMOVE_COUNT.rate(), + StorageMetrics.VDS_FILESTOR_ALLTHREADS_UPDATE_COUNT.rate()); + } }; |