public interface Metric
Metrics are in essence just simple long
values, with any semantics.
They can be used for example for counting things (like number of certain
events) or for storing standalone values (like measurements).
To obtain an instance, use Metrics.metric(java.lang.String)
. The instance is tied to
the processor it was created for and is or is not thread-safe based on the
method that was used to create it.
Modifier and Type | Method and Description |
---|---|
void |
decrement()
Decrements the current value by 1.
|
void |
decrement(long amount)
Decrements the current value by the specified amount.
|
void |
increment()
Increments the current value by 1.
|
void |
increment(long amount)
Increments the current value by the specified amount.
|
String |
name()
Returns the name of the associated metric.
|
void |
set(long newValue)
Sets the current value.
|
Unit |
unit()
Return the measurement unit for the associated metric.
|
@Nonnull Unit unit()
MetricTags.UNIT
tag in the metric's description.void increment()
void increment(long amount)
void decrement()
void decrement(long amount)
void set(long newValue)
Copyright © 2024 Hazelcast, Inc.. All rights reserved.