Class OperatorStats

java.lang.Object
org.apache.drill.exec.ops.OperatorStats

public class OperatorStats extends Object
  • Field Details

    • operatorId

      protected final int operatorId
    • operatorType

      protected final String operatorType
    • recordsReceivedByInput

      public long[] recordsReceivedByInput
    • batchesReceivedByInput

      public long[] batchesReceivedByInput
    • processingNanos

      protected long processingNanos
    • setupNanos

      protected long setupNanos
    • waitNanos

      protected long waitNanos
  • Constructor Details

    • OperatorStats

      public OperatorStats(OpProfileDef def, BufferAllocator allocator)
    • OperatorStats

      public OperatorStats(OperatorStats original, boolean isClean)
      Copy constructor to be able to create a copy of existing stats object shell and use it independently this is useful if stats have to be updated in different threads, since it is not really possible to update such stats as waitNanos, setupNanos and processingNanos across threads
      Parameters:
      original - - OperatorStats object to create a copy from
      isClean - - flag to indicate whether to start with clean state indicators or inherit those from original object
    • OperatorStats

      public OperatorStats(int operatorId, String operatorType, int inputCount, BufferAllocator allocator)
  • Method Details

    • mergeMetrics

      public OperatorStats mergeMetrics(OperatorStats from)
      OperatorStats merger - to merge stats from other OperatorStats this is needed in case some processing is multithreaded that needs to have separate OperatorStats to deal with WARN - this will only work for metrics that can be added
      Parameters:
      from - - OperatorStats from where to merge to "this"
      Returns:
      OperatorStats - for convenience so one can merge multiple stats in one go
    • clear

      public void clear()
      Clear stats
    • startSetup

      public void startSetup()
    • stopSetup

      public void stopSetup()
    • startProcessing

      public void startProcessing()
    • stopProcessing

      public void stopProcessing()
    • startWait

      public void startWait()
    • stopWait

      public void stopWait()
    • batchReceived

      public void batchReceived(int inputIndex, long records, boolean newSchema)
    • getId

      public String getId()
    • getProfile

      public UserBitShared.OperatorProfile getProfile()
    • addAllMetrics

      public void addAllMetrics(UserBitShared.OperatorProfile.Builder builder)
    • addStreamProfile

      public void addStreamProfile(UserBitShared.OperatorProfile.Builder builder)
    • addLongMetrics

      public void addLongMetrics(UserBitShared.OperatorProfile.Builder builder)
    • addDoubleMetrics

      public void addDoubleMetrics(UserBitShared.OperatorProfile.Builder builder)
    • addLongStat

      public void addLongStat(MetricDef metric, long value)
      Set a stat to the specified long value. Creates the stat if the stat does not yet exist.
      Parameters:
      metric - the metric to update
      value - the value to set
    • getLongStat

      public long getLongStat(MetricDef metric)
    • addDoubleStat

      public void addDoubleStat(MetricDef metric, double value)
      Add a double value to the existing value. Creates the stat (with an initial value of zero) if the stat does not yet exist.
      Parameters:
      metric - the metric to update
      value - the value to add to the existing value
    • getDoubleStat

      public double getDoubleStat(MetricDef metric)
    • setLongStat

      public void setLongStat(MetricDef metric, long value)
      Add a long value to the existing value. Creates the stat (with an initial value of zero) if the stat does not yet exist.
      Parameters:
      metric - the metric to update
      value - the value to add to the existing value
    • setDoubleStat

      public void setDoubleStat(MetricDef metric, double value)
      Set a stat to the specified double value. Creates the stat if the stat does not yet exist.
      Parameters:
      metric - the metric to update
      value - the value to set
    • getWaitNanos

      public long getWaitNanos()
    • adjustWaitNanos

      public void adjustWaitNanos(long waitNanosOffset)
      Adjust waitNanos based on client calculations
      Parameters:
      waitNanosOffset - - could be negative as well as positive
    • getProcessingNanos

      public long getProcessingNanos()