public class DropwizardMetricsConfig extends Object
DropwizardMetricsModule
.
Request timing metrics and blocking execution timing metrics are enabled by default.
Modifier and Type | Field and Description |
---|---|
static 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 |
console() |
DropwizardMetricsConfig |
console(Action<? super ConsoleConfig> configure)
Configure the console metrics publisher.
|
DropwizardMetricsConfig |
csv(Action<? super CsvConfig> configure)
Configure the csv metrics publisher.
|
Optional<ConsoleConfig> |
getConsole()
Get the settings for the console metrics publisher.
|
Optional<CsvConfig> |
getCsv()
Get the settings for the csv metrics publisher.
|
Optional<GraphiteConfig> |
getGraphite()
Get the settings for the Graphite metrics publisher.
|
Optional<JmxConfig> |
getJmx()
Get the settings for the JMX metrics publisher.
|
Map<String,String> |
getRequestMetricGroups()
A map of regular expressions used to group request metrics.
|
Optional<Slf4jConfig> |
getSlf4j()
Get the settings for the Slf4j Logger metrics publisher.
|
Optional<WebsocketConfig> |
getWebSocket()
Get the settings for the websockets metrics broadcaster.
|
DropwizardMetricsConfig |
graphite(Action<? super GraphiteConfig> configure)
Configure the Graphite metrics publisher.
|
boolean |
isBlockingTimingMetrics()
The state of blocking timing metrics.
|
boolean |
isJvmMetrics()
The state of jvm metrics collection.
|
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 |
requestMetricGroups(Map<String,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 static final Duration DEFAULT_INTERVAL
public boolean isJvmMetrics()
public DropwizardMetricsConfig jvmMetrics(boolean jvmMetrics)
jvmMetrics
- True if JVM metrics are to be reported. False otherwisepublic 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 Map<String,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(Map<String,String> requestMetricGroups)
requestMetricGroups
- the request metric groupspublic Optional<JmxConfig> getJmx()
public DropwizardMetricsConfig jmx()
jmx(ratpack.func.Action)
public DropwizardMetricsConfig jmx(Action<? super JmxConfig> configure)
configure
- the configuration for the publisherpublic Optional<ConsoleConfig> getConsole()
public DropwizardMetricsConfig console()
console(ratpack.func.Action)
public DropwizardMetricsConfig console(Action<? super ConsoleConfig> configure)
configure
- the configuration for the publisherpublic Optional<Slf4jConfig> getSlf4j()
public DropwizardMetricsConfig slf4j()
slf4j(ratpack.func.Action)
public DropwizardMetricsConfig slf4j(Action<? super Slf4jConfig> configure)
configure
- the configuration for the publisherpublic Optional<WebsocketConfig> getWebSocket()
public DropwizardMetricsConfig webSocket()
webSocket(ratpack.func.Action)
public DropwizardMetricsConfig webSocket(Action<? super WebsocketConfig> configure)
configure
- the configuration for the broadcasterpublic Optional<CsvConfig> getCsv()
public DropwizardMetricsConfig csv(Action<? super CsvConfig> configure)
configure
- the configuration for the publisherpublic Optional<GraphiteConfig> getGraphite()
public DropwizardMetricsConfig graphite(Action<? super GraphiteConfig> configure)
configure
- the configuration for the publisher