ReadWriteDiskValidatorMetrics (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.util, class: ReadWriteDiskValidatorMetrics

Package org.apache.hadoop.util

# Class ReadWriteDiskValidatorMetrics

java.lang.Object
org.apache.hadoop.util.ReadWriteDiskValidatorMetrics

@Private public class ReadWriteDiskValidatorMetrics extends Object
The metrics for a directory generated by `ReadWriteDiskValidator`.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected static final Map<String,ReadWriteDiskValidatorMetrics>`
  `DIR_METRICS`
  Simple metrics cache to help prevent re-registrations and help to access metrics.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ReadWriteDiskValidatorMetrics()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addReadFileLatency(long readLatency)`
  Add the file read latency to `MutableQuantiles` metrics.
  `void`
  `addWriteFileLatency(long writeLatency)`
  Add the file write latency to `MutableQuantiles` metrics.
  `void`
  `diskCheckFailed()`
  Increase the failure count and update the last failure timestamp.
  `protected MutableQuantiles[]`
  `getFileReadQuantiles()`
  Get `MutableQuantiles` metrics for the file read time.
  `protected MutableQuantiles[]`
  `getFileWriteQuantiles()`
  Get `MutableQuantiles` metrics for the file write time.
  `static ReadWriteDiskValidatorMetrics`
  `getMetric(String dirName)`
  Get a metric by given directory name.
  `protected static String`
  `sourceName(String dirName)`
  Get a source name by given directory name.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### DIR_METRICS

    protected static final Map<String,ReadWriteDiskValidatorMetrics> DIR_METRICS
    Simple metrics cache to help prevent re-registrations and help to access metrics.

- ## Constructor Details

  - ### ReadWriteDiskValidatorMetrics

    public ReadWriteDiskValidatorMetrics()

- ## Method Details

  - ### getMetric

    public static ReadWriteDiskValidatorMetrics getMetric(String dirName)
    Get a metric by given directory name.
    Parameters:
      `dirName` - directory name
    Returns:
      the metric

  - ### addWriteFileLatency

    public void addWriteFileLatency(long writeLatency)
    Add the file write latency to `MutableQuantiles` metrics.
    Parameters:
      `writeLatency` - file write latency in microseconds

  - ### addReadFileLatency

    public void addReadFileLatency(long readLatency)
    Add the file read latency to `MutableQuantiles` metrics.
    Parameters:
      `readLatency` - file read latency in microseconds

  - ### sourceName

    protected static String sourceName(String dirName)
    Get a source name by given directory name.
    Parameters:
      `dirName` - directory name
    Returns:
      the source name

  - ### diskCheckFailed

    public void diskCheckFailed()
    Increase the failure count and update the last failure timestamp.

  - ### getFileReadQuantiles

    @VisibleForTesting protected MutableQuantiles[] getFileReadQuantiles()
    Get `MutableQuantiles` metrics for the file read time.
    Returns:
      `MutableQuantiles` metrics for the file read time

  - ### getFileWriteQuantiles

    @VisibleForTesting protected MutableQuantiles[] getFileWriteQuantiles()
    Get `MutableQuantiles` metrics for the file write time.
    Returns:
      `MutableQuantiles` metrics for the file write time