aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryngveaasheim <yngve@yahooinc.com>2023-02-03 12:37:59 +0100
committeryngveaasheim <yngve@yahooinc.com>2023-02-03 12:37:59 +0100
commitce8ea5a1604c7cfffc0f5fd560b2688f20b46963 (patch)
treef33bbd24edd28051cd9fa1f95a426edff6976175
parent2b951244de137a3321c6aa70f52389664cab8efc (diff)
Use enum for some searchnode metrics.
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/admin/monitoring/VespaMetricSet.java61
-rw-r--r--container-core/src/main/java/com/yahoo/metrics/SearchNodeMetrics.java35
2 files changed, 65 insertions, 31 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/admin/monitoring/VespaMetricSet.java b/config-model/src/main/java/com/yahoo/vespa/model/admin/monitoring/VespaMetricSet.java
index b940cfc0a74..c9a46118b98 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/admin/monitoring/VespaMetricSet.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/admin/monitoring/VespaMetricSet.java
@@ -2,6 +2,7 @@
package com.yahoo.vespa.model.admin.monitoring;
import com.yahoo.metrics.ContainerMetrics;
+import com.yahoo.metrics.SearchNodeMetrics;
import com.yahoo.metrics.Suffix;
import java.util.Collections;
@@ -338,29 +339,27 @@ public class VespaMetricSet {
private static Set<Metric> getSearchNodeMetrics() {
Set<Metric> metrics = new LinkedHashSet<>();
- addMetric(metrics, "content.proton.documentdb.documents.total.last");
- addMetric(metrics, "content.proton.documentdb.documents.ready.last");
- addMetric(metrics, "content.proton.documentdb.documents.active.last");
- addMetric(metrics,"content.proton.documentdb.documents.removed.last");
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_DOCUMENTDB_DOCUMENTS_TOTAL.last());
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_DOCUMENTDB_DOCUMENTS_READY.last());
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_DOCUMENTDB_DOCUMENTS_ACTIVE.last());
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_DOCUMENTDB_DOCUMENTS_REMOVED.last());
- addMetric(metrics, "content.proton.documentdb.index.docs_in_memory.last");
- addMetric(metrics, "content.proton.documentdb.disk_usage.last");
- addMetric(metrics,"content.proton.documentdb.memory_usage.allocated_bytes.max");
- addMetric(metrics, "content.proton.documentdb.heart_beat_age.last");
- addMetric(metrics, "content.proton.transport.query.count.rate");
- addMetric(metrics, "content.proton.docsum.docs.rate");
- addMetric(metrics, "content.proton.docsum.latency", List.of("max", "sum", "count"));
- addMetric(metrics, "content.proton.transport.query.latency", List.of("max", "sum", "count"));
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_DOCUMENTDB_INDEX_DOCS_IN_MEMORY.last());
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_DOCUMENTDB_DISK_USAGE.last());
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_DOCUMENTDB_MEMORY_USAGE_ALLOCATED_BYTES.max());
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_DOCUMENTDB_HEART_BEAT_AGE.last());
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_DOCSUM_DOCS.rate());
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_DOCSUM_LATENCY, EnumSet.of(max, sum, count));
// Search protocol
- addMetric(metrics, "content.proton.search_protocol.query.latency", List.of("max", "sum", "count"));
- addMetric(metrics, "content.proton.search_protocol.query.request_size", List.of("max", "sum", "count"));
- addMetric(metrics, "content.proton.search_protocol.query.reply_size", List.of("max", "sum", "count"));
- addMetric(metrics, "content.proton.search_protocol.docsum.latency", List.of("max", "sum", "count"));
- addMetric(metrics, "content.proton.search_protocol.docsum.request_size", List.of("max", "sum", "count"));
- addMetric(metrics, "content.proton.search_protocol.docsum.reply_size", List.of("max", "sum", "count"));
- addMetric(metrics, "content.proton.search_protocol.docsum.requested_documents.count");
-
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_SEARCH_PROTOCOL_QUERY_LATENCY, EnumSet.of(max, sum, count));
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_SEARCH_PROTOCOL_QUERY_REQUEST_SIZE, EnumSet.of(max, sum, average));
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_SEARCH_PROTOCOL_QUERY_REQUEST_SIZE, EnumSet.of(max, sum, average));
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_SEARCH_PROTOCOL_DOCSUM_LATENCY, EnumSet.of(max, sum, average));
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_SEARCH_PROTOCOL_DOCSUM_REQUEST_SIZE, EnumSet.of(max, sum, average));
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_SEARCH_PROTOCOL_DOCSUM_REPLY_SIZE, EnumSet.of(max, sum, average));
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_SEARCH_PROTOCOL_DOCSUM_REQUESTED_DOCUMENTS.count());
+
// Executors shared between all document dbs
addSearchNodeExecutorMetrics(metrics, "content.proton.executor.proton");
addSearchNodeExecutorMetrics(metrics, "content.proton.executor.flush");
@@ -371,15 +370,15 @@ public class VespaMetricSet {
addSearchNodeExecutorMetrics(metrics, "content.proton.executor.field_writer");
// jobs
- addMetric(metrics, "content.proton.documentdb.job.total.average");
- addMetric(metrics, "content.proton.documentdb.job.attribute_flush.average");
- addMetric(metrics, "content.proton.documentdb.job.memory_index_flush.average");
- addMetric(metrics, "content.proton.documentdb.job.disk_index_fusion.average");
- addMetric(metrics, "content.proton.documentdb.job.document_store_flush.average");
- addMetric(metrics, "content.proton.documentdb.job.document_store_compact.average");
- addMetric(metrics, "content.proton.documentdb.job.bucket_move.average");
- addMetric(metrics, "content.proton.documentdb.job.lid_space_compact.average");
- addMetric(metrics, "content.proton.documentdb.job.removed_documents_prune.average");
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_DOCUMENTDB_JOB_TOTAL.average());
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_DOCUMENTDB_JOB_ATTRIBUTE_FLUSH.average());
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_DOCUMENTDB_JOB_MEMORY_INDEX_FLUSH.average());
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_DOCUMENTDB_JOB_DISK_INDEX_FUSION.average());
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_DOCUMENTDB_JOB_DOCUMENT_STORE_FLUSH.average());
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_DOCUMENTDB_JOB_DOCUMENT_STORE_COMPACT.average());
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_DOCUMENTDB_JOB_BUCKET_MOVE.average());
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_DOCUMENTDB_JOB_LID_SPACE_COMPACT.average());
+ addMetric(metrics, SearchNodeMetrics.CONTENT_PROTON_DOCUMENTDB_JOB_REMOVED_DOCUMENTS_PRUNE.average());
// Threading service (per document db)
addSearchNodeExecutorMetrics(metrics, "content.proton.documentdb.threading_service.master");
@@ -681,6 +680,10 @@ public class VespaMetricSet {
suffixes.forEach(suffix -> metrics.add(new Metric(metric.baseName() + "." + suffix.suffix())));
}
+ private static void addMetric(Set<Metric> metrics, SearchNodeMetrics metric, EnumSet<Suffix> suffixes) {
+ suffixes.forEach(suffix -> metrics.add(new Metric(metric.baseName() + "." + suffix.suffix())));
+ }
+
private static void addMetric(Set<Metric> metrics, String metricName, Iterable<String> aggregateSuffices) {
for (String suffix : aggregateSuffices) {
metrics.add(new Metric(metricName + "." + suffix));
diff --git a/container-core/src/main/java/com/yahoo/metrics/SearchNodeMetrics.java b/container-core/src/main/java/com/yahoo/metrics/SearchNodeMetrics.java
index 766accfca8f..65ea0568bee 100644
--- a/container-core/src/main/java/com/yahoo/metrics/SearchNodeMetrics.java
+++ b/container-core/src/main/java/com/yahoo/metrics/SearchNodeMetrics.java
@@ -5,8 +5,39 @@ package com.yahoo.metrics;
*/
public enum SearchNodeMetrics implements VespaMetrics {
- SAMPLE1("sample1", Unit.RESPONSE, "sample1"),
- SAMPLE2("sample1", Unit.RESPONSE, "sample1");
+ CONTENT_PROTON_DOCUMENTDB_DOCUMENTS_TOTAL("content.proton.documentdb.documents.total", Unit.DOCUMENT, "The total number of documents in this documents db (ready + not-ready)"),
+ CONTENT_PROTON_DOCUMENTDB_DOCUMENTS_READY("content.proton.documentdb.documents.ready", Unit.DOCUMENT, "The number of ready documents in this document db"),
+ CONTENT_PROTON_DOCUMENTDB_DOCUMENTS_ACTIVE("content.proton.documentdb.documents.active", Unit.DOCUMENT, "The number of active / searchable documents in this document db"),
+ CONTENT_PROTON_DOCUMENTDB_DOCUMENTS_REMOVED("content.proton.documentdb.documents.removed", Unit.DOCUMENT, "The number of removed documents in this document db"),
+
+ CONTENT_PROTON_DOCUMENTDB_INDEX_DOCS_IN_MEMORY("content.proton.documentdb.index.docs_in_memory", Unit.DOCUMENT, "Number of documents in memory index"),
+ CONTENT_PROTON_DOCUMENTDB_DISK_USAGE("content.proton.documentdb.disk_usage", Unit.BYTE, "The total disk usage (in bytes) for this document db"),
+ CONTENT_PROTON_DOCUMENTDB_MEMORY_USAGE_ALLOCATED_BYTES("content.proton.documentdb.memory_usage.allocated_bytes", Unit.BYTE, "The number of allocated bytes"),
+ CONTENT_PROTON_DOCUMENTDB_HEART_BEAT_AGE("content.proton.documentdb.heart_beat_age", Unit.SECOND, "How long ago (in seconds) heart beat maintenace job was run"),
+ CONTENT_PROTON_DOCSUM_DOCS("content.proton.docsum.docs", Unit.DOCUMENT, "Total docsums returned"),
+ CONTENT_PROTON_DOCSUM_LATENCY("content.proton.docsum.latency", Unit.MILLISECOND, "Docsum request latency"),
+
+ // Search protocol
+ CONTENT_PROTON_SEARCH_PROTOCOL_QUERY_LATENCY("content.proton.search_protocol.query.latency", Unit.SECOND, "Query request latency (seconds)"),
+ CONTENT_PROTON_SEARCH_PROTOCOL_QUERY_REQUEST_SIZE("content.proton.search_protocol.query.request_size", Unit.BYTE, "Query request size (network bytes)"),
+ CONTENT_PROTON_SEARCH_PROTOCOL_QUERY_REPLY_SIZE("content.proton.search_protocol.query.reply_size", Unit.BYTE, "Query reply size (network bytes)"),
+ CONTENT_PROTON_SEARCH_PROTOCOL_DOCSUM_LATENCY("content.proton.search_protocol.docsum.latency", Unit.SECOND, "Docsum request latency (seconds)"),
+ CONTENT_PROTON_SEARCH_PROTOCOL_DOCSUM_REQUEST_SIZE("content.proton.search_protocol.docsum.request_size", Unit.BYTE, "Docsum request size (network bytes)"),
+ CONTENT_PROTON_SEARCH_PROTOCOL_DOCSUM_REPLY_SIZE("content.proton.search_protocol.docsum.reply_size", Unit.BYTE, "Docsum reply size (network bytes)"),
+ CONTENT_PROTON_SEARCH_PROTOCOL_DOCSUM_REQUESTED_DOCUMENTS("content.proton.search_protocol.docsum.requested_documents", Unit.DOCUMENT, "Total requested document summaries"),
+
+ // jobs
+ CONTENT_PROTON_DOCUMENTDB_JOB_TOTAL("content.proton.documentdb.job.total", Unit.FRACTION, "The job load average total of all job metrics"),
+ CONTENT_PROTON_DOCUMENTDB_JOB_ATTRIBUTE_FLUSH("content.proton.documentdb.job.attribute_flush", Unit.FRACTION, "Flushing of attribute vector(s) to disk"),
+ CONTENT_PROTON_DOCUMENTDB_JOB_MEMORY_INDEX_FLUSH("content.proton.documentdb.job.memory_index_flush", Unit.FRACTION, "Flushing of memory index to disk"),
+ CONTENT_PROTON_DOCUMENTDB_JOB_DISK_INDEX_FUSION("content.proton.documentdb.job.disk_index_fusion", Unit.FRACTION, "Fusion of disk indexes"),
+ CONTENT_PROTON_DOCUMENTDB_JOB_DOCUMENT_STORE_FLUSH("content.proton.documentdb.job.document_store_flush", Unit.FRACTION, "Flushing of document store to disk"),
+ CONTENT_PROTON_DOCUMENTDB_JOB_DOCUMENT_STORE_COMPACT("content.proton.documentdb.job.document_store_compact", Unit.FRACTION, "Compaction of document store on disk"),
+ CONTENT_PROTON_DOCUMENTDB_JOB_BUCKET_MOVE("content.proton.documentdb.job.bucket_move", Unit.FRACTION, "Moving of buckets between 'ready' and 'notready' sub databases"),
+ CONTENT_PROTON_DOCUMENTDB_JOB_LID_SPACE_COMPACT("content.proton.documentdb.job.lid_space_compact", Unit.FRACTION, "Compaction of lid space in document meta store and attribute vectors"),
+ CONTENT_PROTON_DOCUMENTDB_JOB_REMOVED_DOCUMENTS_PRUNE("content.proton.documentdb.job.removed_documents_prune", Unit.FRACTION, "Pruning of removed documents in 'removed' sub database");
+
+
private final String name;