public final class JobMetrics extends Object implements IdentifiedDataSerializable
Measurement
s.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 Measurement s found in the current one. |
JobMetrics |
filter(String tagName,
String tagValue)
Convenience method for
filter(Predicate) , returns a new
JobMetrics instance containing only those Measurement s
which have the specified tag set to the specified value. |
List<Measurement> |
get(String metricName)
Returns all
Measurement s 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
Measurement s. |
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
Measurement
s.@Nonnull public List<Measurement> get(@Nonnull String metricName)
Measurement
s 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 Measurement
s
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 Measurement
s found in the current one. The subset is
formed by those Measurement
s which match the provided
Predicate
.
The metric names which have all their Measurement
s filtered
out won't be present in the new JobMetrics
instance.
public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getClassId()
IdentifiedDataSerializable
getClassId
in interface IdentifiedDataSerializable
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- 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
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
input stream has been closed.Copyright © 2023 Hazelcast, Inc.. All rights reserved.