public final class JobMetrics extends Object implements IdentifiedDataSerializable
Measurements.| Modifier and Type | Method and Description |
|---|---|
static JobMetrics |
empty()
Returns an empty
JobMetrics object. |
boolean |
equals(Object obj) |
JobMetrics |
filter(Predicate<Measurement> predicate)
Returns a new
JobMetrics instance containing a subset of
the Measurements found in the current one. |
JobMetrics |
filter(String tagName,
String tagValue)
Convenience method for
filter(Predicate), returns a new
JobMetrics instance containing only those Measurements
which have the specified tag set to the specified value. |
List<Measurement> |
get(String metricName)
Returns all
Measurements associated with a given metric name. |
int |
getClassId()
Returns type identifier for this class.
|
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
int |
hashCode() |
Set<String> |
metrics()
Returns all metrics present.
|
static JobMetrics |
of(Map<String,List<Measurement>> metrics)
Builds a
JobMetrics object based on a map of
Measurements. |
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
String |
toString() |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
@Nonnull @PrivateApi public static JobMetrics empty()
JobMetrics object.@Nonnull @PrivateApi public static JobMetrics of(@Nonnull Map<String,List<Measurement>> metrics)
JobMetrics object based on a map of
Measurements.@Nonnull public List<Measurement> get(@Nonnull String metricName)
Measurements associated with a given metric name.
For a list of job-specific metric names please see MetricNames.
@Nonnull public JobMetrics filter(@Nonnull String tagName, @Nonnull String tagValue)
filter(Predicate), returns a new
JobMetrics instance containing only those Measurements
which have the specified tag set to the specified value.
For a list of available tag names, see MetricTags.
@Nonnull public JobMetrics filter(@Nonnull Predicate<Measurement> predicate)
JobMetrics instance containing a subset of
the Measurements found in the current one. The subset is
formed by those Measurements which match the provided
Predicate.
The metric names which have all their Measurements filtered
out won't be present in the new JobMetrics instance.
public int getFactoryId()
IdentifiedDataSerializablegetFactoryId in interface IdentifiedDataSerializablepublic int getClassId()
IdentifiedDataSerializablegetClassId in interface IdentifiedDataSerializablepublic void writeData(ObjectDataOutput out) throws IOException
DataSerializablewriteData in interface DataSerializableout - outputIOException - if an I/O error occurs. In particular,
an IOException may be thrown if the
output stream has been closed.public void readData(ObjectDataInput in) throws IOException
DataSerializablereadData in interface DataSerializablein - inputIOException - if an I/O error occurs. In particular,
an IOException may be thrown if the
input stream has been closed.Copyright © 2022 Hazelcast, Inc.. All rights reserved.