public class DropwizardMetricsConfig
extends java.lang.Object
DropwizardMetricsModule
.
Request timing metrics and blocking execution timing metrics are enabled by default.
Modifier and Type | Field and Description |
---|---|
static java.time.Duration |
DEFAULT_INTERVAL |
Constructor and Description |
---|
DropwizardMetricsConfig() |
Modifier and Type | Method and Description |
---|---|
DropwizardMetricsConfig |
blockingTimingMetrics(boolean blockingTimingMetrics)
The state of blocking timing metrics reporting.
|
DropwizardMetricsConfig |
byteBufAllocator() |
DropwizardMetricsConfig |
byteBufAllocator(Action<? super ByteBufAllocatorConfig> configure)
Configure the byte buf allocator metric set.
|
DropwizardMetricsConfig |
console() |
DropwizardMetricsConfig |
console(Action<? super ConsoleConfig> configure)
Configure the console metrics publisher.
|
DropwizardMetricsConfig |
csv(Action<? super CsvConfig> configure)
Configure the csv metrics publisher.
|
java.util.Optional<ByteBufAllocatorConfig> |
getByteBufAllocator()
Get the settings for the byte buf allocator metric set.
|
java.util.Optional<ConsoleConfig> |
getConsole()
Get the settings for the console metrics publisher.
|
java.util.Optional<CsvConfig> |
getCsv()
Get the settings for the csv metrics publisher.
|
java.util.Optional<GraphiteConfig> |
getGraphite()
Get the settings for the Graphite metrics publisher.
|
java.util.Optional<HttpClientConfig> |
getHttpClient()
Get the settings for the http client metric set.
|
java.util.Optional<JmxConfig> |
getJmx()
Get the settings for the JMX metrics publisher.
|
java.util.Map<java.lang.String,java.lang.String> |
getRequestMetricGroups()
A map of regular expressions used to group request metrics.
|
java.util.Optional<Slf4jConfig> |
getSlf4j()
Get the settings for the Slf4j Logger metrics publisher.
|
java.util.Optional<WebsocketConfig> |
getWebSocket()
Get the settings for the websockets metrics broadcaster.
|
DropwizardMetricsConfig |
graphite(Action<? super GraphiteConfig> configure)
Configure the Graphite metrics publisher.
|
DropwizardMetricsConfig |
httpClient() |
DropwizardMetricsConfig |
httpClient(Action<? super HttpClientConfig> configure)
Configure the http client metric set.
|
boolean |
isBlockingTimingMetrics()
The state of blocking timing metrics.
|
boolean |
isJvmMetrics()
The state of jvm metrics collection.
|
boolean |
isPrometheusCollection()
The state of the Prometheus metrics collector.
|
boolean |
isRequestTimingMetrics()
The state of request timing metrics.
|
DropwizardMetricsConfig |
jmx() |
DropwizardMetricsConfig |
jmx(Action<? super JmxConfig> configure)
Configure the JMX metrics publisher.
|
DropwizardMetricsConfig |
jvmMetrics(boolean jvmMetrics)
The state of JVM metrics reporting.
|
DropwizardMetricsConfig |
prometheusCollection(boolean prometheusCollection)
The state of Prometheus metrics collection.
|
DropwizardMetricsConfig |
requestMetricGroups(java.util.Map<java.lang.String,java.lang.String> requestMetricGroups)
Configure the request metric groups.
|
DropwizardMetricsConfig |
requestTimingMetrics(boolean requestTimingMetrics)
The state of request timing metrics reporting.
|
DropwizardMetricsConfig |
slf4j() |
DropwizardMetricsConfig |
slf4j(Action<? super Slf4jConfig> configure)
Configure the Slf4j logger metrics publisher.
|
DropwizardMetricsConfig |
webSocket() |
DropwizardMetricsConfig |
webSocket(Action<? super WebsocketConfig> configure)
Configure the websockets metrics broadcaster.
|
public boolean isJvmMetrics()
public DropwizardMetricsConfig jvmMetrics(boolean jvmMetrics)
jvmMetrics
- True if JVM metrics are to be reported. False otherwisepublic boolean isPrometheusCollection()
public DropwizardMetricsConfig prometheusCollection(boolean prometheusCollection)
MetricsPrometheusHandler
to the handler chain.prometheusCollection
- True if metrics should be collected into the Prometheus collector. False otherwiseMetricsPrometheusHandler
public java.util.Optional<ByteBufAllocatorConfig> getByteBufAllocator()
public DropwizardMetricsConfig byteBufAllocator()
byteBufAllocator(ratpack.func.Action)
public DropwizardMetricsConfig byteBufAllocator(Action<? super ByteBufAllocatorConfig> configure)
configure
- the configuration for the byte buf allocator metric setpublic boolean isRequestTimingMetrics()
public DropwizardMetricsConfig requestTimingMetrics(boolean requestTimingMetrics)
requestTimingMetrics
- True if request timing metrics are to be reported. False otherwisepublic boolean isBlockingTimingMetrics()
public DropwizardMetricsConfig blockingTimingMetrics(boolean blockingTimingMetrics)
blockingTimingMetrics
- True if blocking timing metrics are to be reported. False otherwisepublic java.util.Map<java.lang.String,java.lang.String> getRequestMetricGroups()
The value is a regular expression to test the current request path against for a match.
If matched, the key is the name to use when recording the metric. Please note that request
paths do not start with a /
As soon as a match is made against a regular expression no further matches are attempted.
Should no matches be made the default metric grouping will be used.
DefaultRequestTimingHandler
public DropwizardMetricsConfig requestMetricGroups(java.util.Map<java.lang.String,java.lang.String> requestMetricGroups)
requestMetricGroups
- the request metric groupspublic java.util.Optional<JmxConfig> getJmx()
public DropwizardMetricsConfig jmx()
jmx(ratpack.func.Action)
public DropwizardMetricsConfig jmx(Action<? super JmxConfig> configure)
configure
- the configuration for the publisherpublic java.util.Optional<ConsoleConfig> getConsole()
public DropwizardMetricsConfig console()
console(ratpack.func.Action)
public DropwizardMetricsConfig console(Action<? super ConsoleConfig> configure)
configure
- the configuration for the publisherpublic java.util.Optional<Slf4jConfig> getSlf4j()
public DropwizardMetricsConfig slf4j()
slf4j(ratpack.func.Action)
public DropwizardMetricsConfig slf4j(Action<? super Slf4jConfig> configure)
configure
- the configuration for the publisherpublic java.util.Optional<WebsocketConfig> getWebSocket()
public DropwizardMetricsConfig webSocket()
webSocket(ratpack.func.Action)
public DropwizardMetricsConfig webSocket(Action<? super WebsocketConfig> configure)
configure
- the configuration for the broadcasterpublic java.util.Optional<CsvConfig> getCsv()
public DropwizardMetricsConfig csv(Action<? super CsvConfig> configure)
configure
- the configuration for the publisherpublic java.util.Optional<GraphiteConfig> getGraphite()
public DropwizardMetricsConfig graphite(Action<? super GraphiteConfig> configure)
configure
- the configuration for the publisherpublic java.util.Optional<HttpClientConfig> getHttpClient()
public DropwizardMetricsConfig httpClient()
httpClient(ratpack.func.Action)
public DropwizardMetricsConfig httpClient(Action<? super HttpClientConfig> configure)
configure
- the configuration for the http client metric set.