Class ValidationMetrics


  • public class ValidationMetrics
    extends Object
    Validation metrics utility class, which contains the glue code to publish metrics.
    • Constructor Detail

      • ValidationMetrics

        public ValidationMetrics​(PinotMetricsRegistry metricsRegistry)
        Builds the validation metrics.
        Parameters:
        metricsRegistry - The metrics registry used to store all the gauges.
    • Method Detail

      • updateMissingSegmentCountGauge

        public void updateMissingSegmentCountGauge​(String resource,
                                                   int missingSegmentCount)
        Updates the missing segment count gauge.
        Parameters:
        resource - The resource for which the gauge is updated
        missingSegmentCount - The number of missing segments
      • cleanupMissingSegmentCountGauge

        public void cleanupMissingSegmentCountGauge​(String resource)
        Cleans up the missing segment count gauge.
        Parameters:
        resource - The resource for which the gauge is removed
      • updateOfflineSegmentDelayGauge

        public void updateOfflineSegmentDelayGauge​(String resource,
                                                   long lastOfflineSegmentTime)
        Updates the offline segment delay gauge.
        Parameters:
        resource - The resource for which the gauge is updated
        lastOfflineSegmentTime - The last offline segment end time, in milliseconds since the epoch, or Long.MIN_VALUE if there is no such time.
      • cleanupOfflineSegmentDelayGauge

        public void cleanupOfflineSegmentDelayGauge​(String resource)
        Cleans up offline segment delay gauge.
        Parameters:
        resource - The resource for which the gauge is removed
      • updateLastPushTimeGauge

        public void updateLastPushTimeGauge​(String resource,
                                            long lastPushTimeMillis)
        Updates the last push time gauge.
        Parameters:
        resource - The resource for which the gauge is updated
        lastPushTimeMillis - The last push time, in milliseconds since the epoch, or Long.MIN_VALUE if there is no such time.
      • cleanupLastPushTimeGauge

        public void cleanupLastPushTimeGauge​(String resource)
        Cleans up the last push time gauge.
        Parameters:
        resource - The resource for which the gauge is removed
      • updateTotalDocumentCountGauge

        public void updateTotalDocumentCountGauge​(String resource,
                                                  long documentCount)
        Updates the total document count gauge.
        Parameters:
        resource - The resource for which the gauge is updated
        documentCount - Total document count for the given resource name or table name
      • cleanupTotalDocumentCountGauge

        public void cleanupTotalDocumentCountGauge​(String resource)
        Cleans up the total document count gauge.
        Parameters:
        resource - The resource for which the gauge is removed
      • updateNonConsumingPartitionCountMetric

        public void updateNonConsumingPartitionCountMetric​(String resource,
                                                           int partitionCount)
        Updates the non consuming partition count metric.
        Parameters:
        resource - The resource for which the gauge is updated
        partitionCount - Number of partitions that do not have any segment in CONSUMING state.
      • updateSegmentCountGauge

        public void updateSegmentCountGauge​(String resource,
                                            long segmentCount)
        Updates the segment count gauge.
        Parameters:
        resource - The resource for which the gauge is updated
        segmentCount - Total segment count for the given resource name or table name
      • cleanupSegmentCountGauge

        public void cleanupSegmentCountGauge​(String resource)
        Cleans up the segment count gauge.
        Parameters:
        resource - The resource for which the gauge is removed
      • makeGaugeName

        public static String makeGaugeName​(String resource,
                                           String gaugeName)
      • unregisterAllMetrics

        public void unregisterAllMetrics()
        Unregisters all validation metrics.
      • getValueOfGauge

        public long getValueOfGauge​(String fullGaugeName)