Top Description Fields Constructors Methods
io.vertx.core.metrics

public Class MetricsOptions

extends Object
Class Inheritance
Annotations
@DataObject
@JsonGen
publicConverter:false
Imports
io.vertx.codegen.annotations.DataObject, io.vertx.codegen.json.annotations.JsonGen, io.vertx.core.json.JsonObject, io.vertx.core.spi.VertxMetricsFactory, io.vertx.core.spi.cluster.ClusterManager

Vert.x metrics base configuration, this class can be extended by provider implementations to configure those specific implementations.
Author
Julien Viet

Field Summary

Modifier and TypeField and Description
public static final boolean
DEFAULT_METRICS_ENABLED

The default value of metrics enabled false

private boolean
private VertxMetricsFactory
private JsonObject
json

References Deprecated JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

Constructor Summary

AccessConstructor and Description
public
MetricsOptions()

Default constructor

public
MetricsOptions(MetricsOptions
The other MetricsOptions to copy when creating this
other
)

Copy constructor

public
MetricsOptions(JsonObject
the JsonObject to create it from
json
)
References Deprecated JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

Create an instance from a io.vertx.core.json.JsonObject

Method Summary

Modifier and TypeMethod and Description
public VertxMetricsFactory

Returns:

the metrics factory
getFactory
()

Get the metrics factory to be used when metrics are enabled.

public boolean

Returns:

true if enabled, false if not.
isEnabled
()

Will metrics be enabled on the Vert.x instance?

public MetricsOptions

Returns:

a reference to this, so the API can be used fluently
setEnabled
(boolean
true if metrics enabled, or false if not.
enable
)

Set whether metrics will be enabled on the Vert.x instance.

public MetricsOptions

Returns:

a reference to this, so the API can be used fluently
setFactory
(VertxMetricsFactory
the metrics factory
factory
)

Programmatically set the metrics factory to be used when metrics are enabled.

public JsonObject
toJson()
References Deprecated JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

DEFAULT_METRICS_ENABLEDback to summary
public static final boolean DEFAULT_METRICS_ENABLED

The default value of metrics enabled false

enabledback to summary
private boolean enabled
factoryback to summary
private VertxMetricsFactory factory
jsonback to summary
private JsonObject json

References Deprecated

JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Constructor Detail

MetricsOptionsback to summary
public MetricsOptions()

Default constructor

MetricsOptionsback to summary
public MetricsOptions(MetricsOptions other)

Copy constructor

Parameters
other:MetricsOptions

The other MetricsOptions to copy when creating this

MetricsOptionsback to summary
public MetricsOptions(JsonObject json)

References Deprecated

JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Create an instance from a io.vertx.core.json.JsonObject

Parameters
json:JsonObject

the JsonObject to create it from

Method Detail

getFactoryback to summary
public VertxMetricsFactory getFactory()

Get the metrics factory to be used when metrics are enabled.

If the metrics factory has been programmatically set here, then that will be used when metrics are enabled for creating the io.vertx.core.spi.metrics.VertxMetrics instance.

Otherwise Vert.x attempts to locate a metrics factory implementation on the classpath.

Returns:VertxMetricsFactory

the metrics factory

isEnabledback to summary
public boolean isEnabled()

Will metrics be enabled on the Vert.x instance?

Returns:boolean

true if enabled, false if not.

setEnabledback to summary
public MetricsOptions setEnabled(boolean enable)

Set whether metrics will be enabled on the Vert.x instance.

Parameters
enable:boolean

true if metrics enabled, or false if not.

Returns:MetricsOptions

a reference to this, so the API can be used fluently

setFactoryback to summary
public MetricsOptions setFactory(VertxMetricsFactory factory)

Programmatically set the metrics factory to be used when metrics are enabled.

Only valid if MetricsOptions#isEnabled = true.

Normally Vert.x will look on the classpath for a metrics factory implementation, but if you want to set one programmatically you can use this method.

Parameters
factory:VertxMetricsFactory

the metrics factory

Returns:MetricsOptions

a reference to this, so the API can be used fluently

Annotations
@Deprecated
toJsonback to summary
public JsonObject toJson()

References Deprecated

JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override