public class MetricsConfig extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_METRICS_COLLECTION_SECONDS
Default collection interval for metrics
|
static int |
DEFAULT_METRICS_RETENTION_SECONDS
Default retention period for metrics.
|
Constructor and Description |
---|
MetricsConfig() |
Modifier and Type | Method and Description |
---|---|
int |
getCollectionIntervalSeconds()
Returns the metrics collection interval.
|
int |
getRetentionSeconds()
Returns the number of seconds the metrics will be retained on the
instance.
|
boolean |
isEnabled()
Returns if metrics collection is enabled.
|
boolean |
isJmxEnabled()
Returns whether metrics will be exposed through JMX MBeans.
|
boolean |
isMetricsForDataStructuresEnabled()
Returns if statistics for data structures are added to metrics.
|
MetricsConfig |
setCollectionIntervalSeconds(int intervalSeconds)
Sets the metrics collection interval in seconds.
|
MetricsConfig |
setEnabled(boolean enabled)
Sets whether metrics collection should be enabled for the node.
|
MetricsConfig |
setJmxEnabled(boolean jmxEnabled)
Enables metrics exposure through JMX.
|
MetricsConfig |
setMetricsForDataStructuresEnabled(boolean metricsForDataStructuresEnabled)
Sets whether statistics for data structures are added to metrics.
|
MetricsConfig |
setRetentionSeconds(int retentionSeconds)
Returns the number of seconds the metrics will be retained on the
instance.
|
public static final int DEFAULT_METRICS_COLLECTION_SECONDS
public static final int DEFAULT_METRICS_RETENTION_SECONDS
@Nonnull public MetricsConfig setEnabled(boolean enabled)
public boolean isEnabled()
public boolean isJmxEnabled()
public MetricsConfig setJmxEnabled(boolean jmxEnabled)
Metrics are exposed by converting the metric name to a structure that
will be rendered in a tree structure in tools showing the beans (Java
Mission Control or JConsole). MBean is identified by a ObjectName
which contains tag-value tuples. Although
the order of tags is insignificant to the identity, the UI tools use the
order of tags to generate tree structure and only display the values,
not the tag names. Metric names also have tags and values, but in order
to display the tag name in the UI, we use "tag=value"
as a
value. For example, the metric:
[module=jet,job=123,vertex=a,metric=emittedCount]will be rendered as an attribute named
emittedCount
in an MBean
identified by:
com.hazelcast.jet:type=Metrics,instance=<instanceName>,tag0="job=123",tag1="vertex=a"
This will cause the MBean to be rendered in a tree under com.hazelcast.jet/Metrics/<instanceName>/job=123/vertex=a
nodes. For
the old-style metric names, the name will be split on dots ('.') and a
tag will be created for each level. The element after the last dot will
be used as metric name.
Also some other tags are treated specially, namely unit
(it is
copied to attribute description), module
(it is appended to the
domain) and metric
(it will be converted to attribute name in
the MBean).
@Nonnull public MetricsConfig setRetentionSeconds(int retentionSeconds)
This setting applies only to Jet Management Center metrics API. It doesn't affect how metrics are exposed through JMX.
public int getRetentionSeconds()
@Nonnull public MetricsConfig setCollectionIntervalSeconds(int intervalSeconds)
public int getCollectionIntervalSeconds()
@Nonnull public MetricsConfig setMetricsForDataStructuresEnabled(boolean metricsForDataStructuresEnabled)
Diagnostics.METRICS_DISTRIBUTED_DATASTRUCTURES
. It's disabled by
default.public boolean isMetricsForDataStructuresEnabled()
Diagnostics.METRICS_DISTRIBUTED_DATASTRUCTURES
.Copyright © 2019 Hazelcast, Inc.. All rights reserved.