Class QueryPerformanceReadTracker

java.lang.Object
io.deephaven.engine.readtracker.impl.QueryPerformanceReadTracker

public class QueryPerformanceReadTracker extends Object
Helper to accumulate the number of data reads and meta-data operations performed by the I/O subsystem.

Instances are thread local; no synchronization is required because multiple threads are never permitted to access them simultaneously.

  • Method Details

    • recordRead

      public static void recordRead(long nanos, long bytesRead)
      Record a data read operation. Accumulates into the current thread's cumulative counters.

      If the bytes read is less than zero, the read is not recorded.

      Parameters:
      nanos - time spent on the read in nanoseconds
      bytesRead - number of bytes read
    • recordMetadataOperation

      public static void recordMetadataOperation(long nanos)
      Record a metadata operation (e.g. listing files, checking existence, determining file sizes). Accumulates into the current thread's cumulative counters.
      Parameters:
      nanos - time spent on the metadata operation in nanoseconds
    • forCurrentThread

      public static QueryPerformanceReadTracker forCurrentThread()
      Gets the tracker for the current thread. The tracker is not thread-safe and is mutable. You must capture any values from the tracker rather than holding a reference to the returned object.
      Returns:
      the tracker for the current thread
    • getDataReadNanos

      public long getDataReadNanos()
      Get the cumulative data read nanos for this tracker.
      Returns:
      total data read nanos accumulated for this tracker
    • getDataReadCount

      public long getDataReadCount()
      Get the cumulative data read count for this tracker.
      Returns:
      total data read count accumulated on this tracker
    • getDataReadBytes

      public long getDataReadBytes()
      Get the cumulative data read bytes for this tracker.
      Returns:
      total data read bytes accumulated on this tracker
    • getMetadataOperationNanos

      public long getMetadataOperationNanos()
      Get the cumulative metadata read nanos for this tracker.
      Returns:
      total metadata read nanos accumulated on this tracker
    • getMetadataOperationCount

      public long getMetadataOperationCount()
      Get the cumulative metadata read count for this tracker.
      Returns:
      total metadata read count accumulated on this tracker