Class Measurement

java.lang.Object
com.hazelcast.jet.core.metrics.Measurement
All Implemented Interfaces:
DataSerializable, IdentifiedDataSerializable

public final class Measurement extends Object implements 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 Details

    • of

      @Nonnull public static Measurement of(@Nonnull String metric, long value, long timestamp, @Nonnull Map<String,String> tags)
      Builds a Measurement instance based on timestamp, value and the metric descriptor in map form.
    • value

      public long value()
      Returns the value associated with this Measurement.
    • timestamp

      public long timestamp()
      Returns the timestamps associated with this Measurement, the moment when the value was gathered.
    • metric

      @Nonnull public String metric()
      Returns the name of the metric. For a list of different metrics see MetricNames.
    • tag

      @Nullable public String tag(String name)
      Returns the value associated with a specific tag, based on the metric description of this particular Measurement. For a list of possible tag names see MetricTags.
    • getFactoryId

      public int getFactoryId()
      Description copied from interface: IdentifiedDataSerializable
      Returns DataSerializableFactory factory ID for this class.
      Specified by:
      getFactoryId in interface IdentifiedDataSerializable
      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 interface IdentifiedDataSerializable
      Returns:
      type ID
    • writeData

      public void writeData(ObjectDataOutput out) throws IOException
      Description copied from interface: DataSerializable
      Writes object fields to output stream
      Specified by:
      writeData in interface DataSerializable
      Parameters:
      out - output
      Throws:
      IOException - if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
    • readData

      public void readData(ObjectDataInput in) throws IOException
      Description copied from interface: DataSerializable
      Reads fields from the input stream
      Specified by:
      readData in interface DataSerializable
      Parameters:
      in - input
      Throws:
      IOException - if an I/O error occurs. In particular, an IOException may be thrown if the input stream has been closed.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object