Package io.vertx.ext.dropwizard
Class DropwizardMetricsOptions
- java.lang.Object
-
- io.vertx.core.metrics.MetricsOptions
-
- io.vertx.ext.dropwizard.DropwizardMetricsOptions
-
public class DropwizardMetricsOptions extends MetricsOptions
Vert.x Dropwizard metrics configuration.- Author:
- Julien Viet
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_JMX_ENABLEDThe default value of JMX enabled =falsestatic List<Match>DEFAULT_MONITORED_HANDLERSThe default monitored handlers :nullstatic List<Match>DEFAULT_MONITORED_HTTP_CLIENT_ENDPOINTSThe default monitored http client endpoints :nullstatic List<Match>DEFAULT_MONITORED_HTTP_CLIENT_URISThe default monitored http client uris :nullstatic List<Match>DEFAULT_MONITORED_HTTP_SERVER_ROUTESThe default monitored http server routes :nullstatic List<Match>DEFAULT_MONITORED_HTTP_SERVER_URISThe default monitored http server uris :null-
Fields inherited from class io.vertx.core.metrics.MetricsOptions
DEFAULT_METRICS_ENABLED
-
-
Constructor Summary
Constructors Constructor Description DropwizardMetricsOptions()Default constructorDropwizardMetricsOptions(JsonObject json)Create an instance from aJsonObjectDropwizardMetricsOptions(MetricsOptions other)Copy constructor with base metrics optionsDropwizardMetricsOptions(DropwizardMetricsOptions other)Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DropwizardMetricsOptionsaddMonitoredEventBusHandler(Match match)Add a monitored event bus handler.DropwizardMetricsOptionsaddMonitoredHttpClientEndpoint(Match match)Add an monitored http client endpoint.DropwizardMetricsOptionsaddMonitoredHttpClientUri(Match match)Add an monitored http client uri.DropwizardMetricsOptionsaddMonitoredHttpServerRoute(Match match)Add an monitored http server route.DropwizardMetricsOptionsaddMonitoredHttpServerUri(Match match)Add an monitored http server uri.StringgetBaseName()StringgetConfigPath()StringgetJmxDomain()Get the JMX domain to use when JMX metrics are enabled.List<Match>getMonitoredEventBusHandlers()List<Match>getMonitoredHttpClientEndpoint()List<Match>getMonitoredHttpClientUris()List<Match>getMonitoredHttpServerRoutes()List<Match>getMonitoredHttpServerUris()StringgetRegistryName()An optional name used for registering the metrics in the Dropwizard shared registry.booleanisJmxEnabled()Will JMX be enabled on the Vert.x instance?DropwizardMetricsOptionssetBaseName(String baseName)Set a custom baseName for metrics.DropwizardMetricsOptionssetConfigPath(String configPath)Set the path for a config file that contains options in JSON format, to be used to create a new options object.DropwizardMetricsOptionssetEnabled(boolean enable)Set whether metrics will be enabled on the Vert.x instance.DropwizardMetricsOptionssetJmxDomain(String jmxDomain)Set the JMX domain to use when JMX metrics are enabled.DropwizardMetricsOptionssetJmxEnabled(boolean jmxEnabled)Set whether JMX will be enabled on the Vert.x instance.DropwizardMetricsOptionssetRegistryName(String registryName)Set the name used for registering the metrics in the Dropwizard shared registry.JsonObjecttoJson()-
Methods inherited from class io.vertx.core.metrics.MetricsOptions
isEnabled, toString
-
-
-
-
Field Detail
-
DEFAULT_JMX_ENABLED
public static final boolean DEFAULT_JMX_ENABLED
The default value of JMX enabled =false- See Also:
- Constant Field Values
-
DEFAULT_MONITORED_HANDLERS
public static final List<Match> DEFAULT_MONITORED_HANDLERS
The default monitored handlers :null
-
DEFAULT_MONITORED_HTTP_SERVER_URIS
public static final List<Match> DEFAULT_MONITORED_HTTP_SERVER_URIS
The default monitored http server uris :null
-
DEFAULT_MONITORED_HTTP_SERVER_ROUTES
public static final List<Match> DEFAULT_MONITORED_HTTP_SERVER_ROUTES
The default monitored http server routes :null
-
DEFAULT_MONITORED_HTTP_CLIENT_URIS
public static final List<Match> DEFAULT_MONITORED_HTTP_CLIENT_URIS
The default monitored http client uris :null
-
-
Constructor Detail
-
DropwizardMetricsOptions
public DropwizardMetricsOptions()
Default constructor
-
DropwizardMetricsOptions
public DropwizardMetricsOptions(MetricsOptions other)
Copy constructor with base metrics options- Parameters:
other- The otherMetricsOptionsto copy when creating this
-
DropwizardMetricsOptions
public DropwizardMetricsOptions(DropwizardMetricsOptions other)
Copy constructor- Parameters:
other- The otherDropwizardMetricsOptionsto copy when creating this
-
DropwizardMetricsOptions
public DropwizardMetricsOptions(JsonObject json)
Create an instance from aJsonObject- Parameters:
json- the JsonObject to create it from
-
-
Method Detail
-
getRegistryName
public String getRegistryName()
An optional name used for registering the metrics in the Dropwizard shared registry.- Returns:
- the registry name
-
setRegistryName
public DropwizardMetricsOptions setRegistryName(String registryName)
Set the name used for registering the metrics in the Dropwizard shared registry.- Parameters:
registryName- the name- Returns:
- a reference to this, so the API can be used fluently
-
isJmxEnabled
public boolean isJmxEnabled()
Will JMX be enabled on the Vert.x instance?- Returns:
- true if enabled, false if not.
-
setJmxEnabled
public DropwizardMetricsOptions setJmxEnabled(boolean jmxEnabled)
Set whether JMX will be enabled on the Vert.x instance.- Parameters:
jmxEnabled- true if JMX enabled, or false if not.- Returns:
- a reference to this, so the API can be used fluently
-
getJmxDomain
public String getJmxDomain()
Get the JMX domain to use when JMX metrics are enabled.- Returns:
- the JMX domain
-
setJmxDomain
public DropwizardMetricsOptions setJmxDomain(String jmxDomain)
Set the JMX domain to use when JMX metrics are enabled.- Parameters:
jmxDomain- the JMX domain- Returns:
- a reference to this, so the API can be used fluently
-
getMonitoredEventBusHandlers
public List<Match> getMonitoredEventBusHandlers()
- Returns:
- the list of monitored event bus handlers
-
addMonitoredEventBusHandler
public DropwizardMetricsOptions addMonitoredEventBusHandler(Match match)
Add a monitored event bus handler.- Parameters:
match- the event bus address match- Returns:
- a reference to this, so the API can be used fluently
-
getMonitoredHttpServerUris
public List<Match> getMonitoredHttpServerUris()
- Returns:
- the list of monitored http server uris
-
addMonitoredHttpServerUri
public DropwizardMetricsOptions addMonitoredHttpServerUri(Match match)
Add an monitored http server uri.- Parameters:
match- the handler match- Returns:
- a reference to this, so the API can be used fluently
-
getMonitoredHttpServerRoutes
public List<Match> getMonitoredHttpServerRoutes()
- Returns:
- the list of monitored http server routes
-
addMonitoredHttpServerRoute
public DropwizardMetricsOptions addMonitoredHttpServerRoute(Match match)
Add an monitored http server route.- Parameters:
match- the handler match- Returns:
- a reference to this, so the API can be used fluently
-
getMonitoredHttpClientUris
public List<Match> getMonitoredHttpClientUris()
- Returns:
- the list of monitored http client uris
-
setEnabled
public DropwizardMetricsOptions setEnabled(boolean enable)
Description copied from class:MetricsOptionsSet whether metrics will be enabled on the Vert.x instance.- Overrides:
setEnabledin classMetricsOptions- Parameters:
enable- true if metrics enabled, or false if not.- Returns:
- a reference to this, so the API can be used fluently
-
getConfigPath
public String getConfigPath()
- Returns:
- the path for a config file to create an Options object from.
-
setConfigPath
public DropwizardMetricsOptions setConfigPath(String configPath)
Set the path for a config file that contains options in JSON format, to be used to create a new options object. The file will be looked for on the file system first and then on the classpath if it's not found.- Parameters:
configPath- the file name- Returns:
- a reference to this, so the API can be used fluently
-
addMonitoredHttpClientUri
public DropwizardMetricsOptions addMonitoredHttpClientUri(Match match)
Add an monitored http client uri.- Parameters:
match- the handler match- Returns:
- a reference to this, so the API can be used fluently
-
addMonitoredHttpClientEndpoint
public DropwizardMetricsOptions addMonitoredHttpClientEndpoint(Match match)
Add an monitored http client endpoint.- Parameters:
match- the handler match- Returns:
- a reference to this, so the API can be used fluently
-
getMonitoredHttpClientEndpoint
public List<Match> getMonitoredHttpClientEndpoint()
- Returns:
- the list of monitored http client endpoints
-
setBaseName
public DropwizardMetricsOptions setBaseName(String baseName)
Set a custom baseName for metrics.- Parameters:
baseName- the new baseName.- Returns:
- a reference to this, so the API can be used fluently
-
getBaseName
public String getBaseName()
- Returns:
- The custom baseName.
-
toJson
public JsonObject toJson()
- Overrides:
toJsonin classMetricsOptions- Returns:
- a JSON representation of these options
-
-