Package com.hazelcast.jet.core.metrics
Class JobMetrics
java.lang.Object
com.hazelcast.jet.core.metrics.JobMetrics
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
public final class JobMetrics extends Object implements IdentifiedDataSerializable
An immutable collection of job-specific metrics, pairs of metric names
and sets of associated
Measurement
s.- Since:
- 3.2
-
Method Summary
Modifier and Type Method Description static JobMetrics
empty()
Returns an emptyJobMetrics
object.boolean
equals(Object obj)
JobMetrics
filter(String tagName, String tagValue)
Convenience method for#filter(Predicate
, returns a new) JobMetrics
instance containing only thoseMeasurement
s which have the specified tag set to the specified value.JobMetrics
filter(Predicate<Measurement> predicate)
Returns a newJobMetrics
instance containing a subset of theMeasurement
s found in the current one.List<Measurement>
get(String metricName)
Returns allMeasurement
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 aJobMetrics
object based on a map ofMeasurement
s.void
readData(ObjectDataInput in)
Reads fields from the input streamString
toString()
void
writeData(ObjectDataOutput out)
Writes object fields to output stream
-
Method Details
-
empty
Returns an emptyJobMetrics
object. -
of
Builds aJobMetrics
object based on a map ofMeasurement
s. -
metrics
Returns all metrics present. -
get
Returns allMeasurement
s associated with a given metric name.For a list of job-specific metric names please see
MetricNames
. -
filter
Convenience method for#filter(Predicate
, returns a new) JobMetrics
instance containing only thoseMeasurement
s which have the specified tag set to the specified value.For a list of available tag names, see
MetricTags
. -
filter
Returns a newJobMetrics
instance containing a subset of theMeasurement
s found in the current one. The subset is formed by thoseMeasurement
s which match the providedPredicate
.The metric names which have all their
Measurement
s filtered out won't be present in the newJobMetrics
instance. -
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
-