Package com.hazelcast.jet.core.metrics
Interface Metric
public interface Metric
Handler for manipulating one user-defined 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.
- Since:
- Jet 4.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Decrements the current value by 1.void
decrement
(long amount) Decrements the current value by the specified amount.void
Increments the current value by 1.void
increment
(long amount) Increments the current value by the specified amount.name()
Returns the name of the associated metric.void
set
(long newValue) Sets the current value.unit()
Return the measurement unit for the associated metric.
-
Method Details
-
name
Returns the name of the associated metric. -
unit
Return the measurement unit for the associated metric. Meant to provide further information on the type of value measured by the user-defined metric. Doesn't affect the functionality of the metric, it still remains a simple numeric value, but is used to populate theMetricTags.UNIT
tag in the metric's description. -
increment
void increment()Increments the current value by 1. -
increment
void increment(long amount) Increments the current value by the specified amount. -
decrement
void decrement()Decrements the current value by 1. -
decrement
void decrement(long amount) Decrements the current value by the specified amount. -
set
void set(long newValue) Sets the current value.
-