Class JobMetrics

    • Method Detail

      • metrics

        @Nonnull
        public java.util.Set<java.lang.String> metrics()
        Returns all metrics present.
      • get

        @Nonnull
        public java.util.List<Measurement> get​(@Nonnull
                                               java.lang.String metricName)
        Returns all Measurements associated with a given metric name.

        For a list of job-specific metric names please see MetricNames.

      • filter

        @Nonnull
        public JobMetrics filter​(@Nonnull
                                 java.lang.String tagName,
                                 @Nonnull
                                 java.lang.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.

        For a list of available tag names, see MetricTags.

      • containsTag

        public boolean containsTag​(@Nonnull
                                   java.lang.String tagName)
        Returns true if there is any Measurement that has the specified tag.
        Since:
        5.4
      • filter

        @Nonnull
        public JobMetrics filter​(@Nonnull
                                 java.util.function.Predicate<Measurement> predicate)
        Returns a new 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.

      • writeData

        public void writeData​(ObjectDataOutput out)
                       throws java.io.IOException
        Description copied from interface: DataSerializable
        Writes object fields to output stream
        Specified by:
        writeData in interface DataSerializable
        Parameters:
        out - output
        Throws:
        java.io.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 java.io.IOException
        Description copied from interface: DataSerializable
        Reads fields from the input stream
        Specified by:
        readData in interface DataSerializable
        Parameters:
        in - input
        Throws:
        java.io.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 java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object