Package org.apache.pinot.common.metrics
Class ValidationMetrics
- java.lang.Object
-
- org.apache.pinot.common.metrics.ValidationMetrics
-
public class ValidationMetrics extends Object
Validation metrics utility class, which contains the glue code to publish metrics.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classValidationMetrics.ValidationMetricNameNames of validation metrics.
-
Constructor Summary
Constructors Constructor Description ValidationMetrics(PinotMetricsRegistry metricsRegistry)Builds the validation metrics.
-
Method Summary
Modifier and Type Method Description voidcleanupLastPushTimeGauge(String resource)Cleans up the last push time gauge.voidcleanupMissingSegmentCountGauge(String resource)Cleans up the missing segment count gauge.voidcleanupOfflineSegmentDelayGauge(String resource)Cleans up offline segment delay gauge.voidcleanupSegmentCountGauge(String resource)Cleans up the segment count gauge.voidcleanupTotalDocumentCountGauge(String resource)Cleans up the total document count gauge.longgetValueOfGauge(String fullGaugeName)static StringmakeGaugeName(String resource, String gaugeName)voidunregisterAllMetrics()Unregisters all validation metrics.voidupdateLastPushTimeGauge(String resource, long lastPushTimeMillis)Updates the last push time gauge.voidupdateMissingSegmentCountGauge(String resource, int missingSegmentCount)Updates the missing segment count gauge.voidupdateNonConsumingPartitionCountMetric(String resource, int partitionCount)Updates the non consuming partition count metric.voidupdateOfflineSegmentDelayGauge(String resource, long lastOfflineSegmentTime)Updates the offline segment delay gauge.voidupdateSegmentCountGauge(String resource, long segmentCount)Updates the segment count gauge.voidupdateTotalDocumentCountGauge(String resource, long documentCount)Updates the total document count gauge.
-
-
-
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 updatedmissingSegmentCount- 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 updatedlastOfflineSegmentTime- 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 updatedlastPushTimeMillis- 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 updateddocumentCount- 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 updatedpartitionCount- 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 updatedsegmentCount- 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
-
unregisterAllMetrics
public void unregisterAllMetrics()
Unregisters all validation metrics.
-
getValueOfGauge
public long getValueOfGauge(String fullGaugeName)
-
-