forked from vespa-engine/vespa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert "Gjoranv/add default public metrics consumer" MERGEOK"
- Loading branch information
Showing
17 changed files
with
344 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
config-model/src/main/java/com/yahoo/vespa/model/admin/monitoring/DefaultPublicConsumer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. | ||
*/ | ||
|
||
package com.yahoo.vespa.model.admin.monitoring; | ||
|
||
import ai.vespa.metricsproxy.http.GenericMetricsHandler; | ||
import com.google.common.collect.ImmutableList; | ||
|
||
import static com.yahoo.vespa.model.admin.monitoring.DefaultPublicMetrics.defaultPublicMetricSet; | ||
import static com.yahoo.vespa.model.admin.monitoring.DefaultVespaMetrics.defaultVespaMetricSet; | ||
import static com.yahoo.vespa.model.admin.monitoring.SystemMetrics.systemMetricSet; | ||
import static java.util.Collections.emptyList; | ||
|
||
/** | ||
* @author gjoranv | ||
*/ | ||
public class DefaultPublicConsumer { | ||
|
||
public static final String DEFAULT_PUBLIC_CONSUMER_ID = GenericMetricsHandler.DEFAULT_PUBLIC_CONSUMER_ID.id; | ||
|
||
private static final MetricSet publicConsumerMetrics = new MetricSet("public-consumer-metrics", | ||
emptyList(), | ||
ImmutableList.of(defaultPublicMetricSet, | ||
defaultVespaMetricSet, | ||
systemMetricSet)); | ||
|
||
public static MetricsConsumer getDefaultPublicConsumer() { | ||
return new MetricsConsumer(DEFAULT_PUBLIC_CONSUMER_ID, publicConsumerMetrics); | ||
} | ||
|
||
} |
69 changes: 69 additions & 0 deletions
69
config-model/src/main/java/com/yahoo/vespa/model/admin/monitoring/DefaultPublicMetrics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. | ||
*/ | ||
|
||
package com.yahoo.vespa.model.admin.monitoring; | ||
|
||
|
||
import com.google.common.collect.ImmutableSet; | ||
|
||
import java.util.LinkedHashSet; | ||
import java.util.Set; | ||
|
||
import static java.util.Collections.emptyList; | ||
|
||
/** | ||
* TODO: Add content metrics. | ||
* | ||
* @author gjoranv | ||
*/ | ||
public class DefaultPublicMetrics { | ||
|
||
public static MetricSet defaultPublicMetricSet = createMetricSet(); | ||
|
||
private static MetricSet createMetricSet() { | ||
return new MetricSet("public", | ||
getAllMetrics(), | ||
emptyList()); | ||
} | ||
|
||
private static Set<Metric> getAllMetrics() { | ||
return ImmutableSet.<Metric>builder() | ||
.addAll(getContainerMetrics()) | ||
.addAll(getQrserverMetrics()) | ||
.build(); | ||
} | ||
|
||
private static Set<Metric> getContainerMetrics() { | ||
Set<Metric> metrics = new LinkedHashSet<>(); | ||
|
||
metrics.add(new Metric("http.status.1xx.rate")); | ||
metrics.add(new Metric("http.status.2xx.rate")); | ||
metrics.add(new Metric("http.status.3xx.rate")); | ||
metrics.add(new Metric("http.status.4xx.rate")); | ||
metrics.add(new Metric("http.status.5xx.rate")); | ||
metrics.add(new Metric("jdisc.gc.ms.average")); | ||
metrics.add(new Metric("mem.heap.free.average")); | ||
|
||
return metrics; | ||
} | ||
|
||
private static Set<Metric> getQrserverMetrics() { | ||
Set<Metric> metrics = new LinkedHashSet<>(); | ||
|
||
metrics.add(new Metric("queries.rate")); | ||
metrics.add(new Metric("query_latency.average")); | ||
metrics.add(new Metric("query_latency.95percentile")); | ||
metrics.add(new Metric("query_latency.99percentile")); | ||
metrics.add(new Metric("hits_per_query.average")); | ||
metrics.add(new Metric("totalhits_per_query.average")); | ||
metrics.add(new Metric("degraded_queries.rate")); | ||
metrics.add(new Metric("failed_queries.rate")); | ||
metrics.add(new Metric("serverActiveThreads.average")); | ||
|
||
return metrics; | ||
} | ||
|
||
private DefaultPublicMetrics() { } | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.