Package com.hazelcast.jet.core.metrics
Class Measurement
java.lang.Object
com.hazelcast.jet.core.metrics.Measurement
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
Immutable data class containing information about one metric measurement,
consisting of:
- metric value
- metric timestamp, generated when the metric was gathered
- metric descriptor (set of tag name-value pairs)
A metrics descriptor can be thought of as a set of attributes associated
with a particular metric, metric which in turn is defined by its name
(for a full list of metric names provided see MetricNames
).
The attributes are specified as tags that have names and values (for a
full list of tag names see MetricTags
). An example
descriptor would have a collection of tags/attributes like this:
module=jet, job=jobId, exec=execId, vertex=filter, proc=3,
unit=count, metric=queuesCapacity, ...
- Since:
- Jet 3.2
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Returns type identifier for this class.int
Returns DataSerializableFactory factory ID for this class.int
hashCode()
metric()
Returns the name of the metric.static Measurement
Builds aMeasurement
instance based on timestamp, value and the metric descriptor in map form.void
Reads fields from the input streamReturns the value associated with a specific tag, based on the metric description of this particularMeasurement
.long
Returns the timestamps associated with thisMeasurement
, the moment when the value was gathered.toString()
long
value()
Returns the value associated with thisMeasurement
.void
Writes object fields to output stream
-
Method Details
-
of
@Nonnull public static Measurement of(@Nonnull String metric, long value, long timestamp, @Nonnull Map<String, String> tags) Builds aMeasurement
instance based on timestamp, value and the metric descriptor in map form. -
value
public long value()Returns the value associated with thisMeasurement
. -
timestamp
public long timestamp()Returns the timestamps associated with thisMeasurement
, the moment when the value was gathered. -
metric
Returns the name of the metric. For a list of different metrics seeMetricNames
. -
tag
Returns the value associated with a specific tag, based on the metric description of this particularMeasurement
. For a list of possible tag names seeMetricTags
. -
getFactoryId
public int getFactoryId()Description copied from interface:IdentifiedDataSerializable
Returns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryId
in interfaceIdentifiedDataSerializable
- Returns:
- factory ID
-
getClassId
public int getClassId()Description copied from interface:IdentifiedDataSerializable
Returns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
getClassId
in interfaceIdentifiedDataSerializable
- Returns:
- type ID
-
writeData
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Parameters:
out
- output- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Parameters:
in
- input- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
hashCode
public int hashCode() -
equals
-
toString
-