Class OperatorStats

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

public class OperatorStats extends Object
  • Field Details Link icon

    • operatorId Link icon

      protected final int operatorId
    • operatorType Link icon

      protected final String operatorType
    • recordsReceivedByInput Link icon

      public long[] recordsReceivedByInput
    • batchesReceivedByInput Link icon

      public long[] batchesReceivedByInput
    • processingNanos Link icon

      protected long processingNanos
    • setupNanos Link icon

      protected long setupNanos
    • waitNanos Link icon

      protected long waitNanos
  • Constructor Details Link icon

    • OperatorStats Link icon

      public OperatorStats(OpProfileDef def, BufferAllocator allocator)
    • OperatorStats Link icon

      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 Link icon

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

    • mergeMetrics Link icon

      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 Link icon

      public void clear()
      Clear stats
    • startSetup Link icon

      public void startSetup()
    • stopSetup Link icon

      public void stopSetup()
    • startProcessing Link icon

      public void startProcessing()
    • stopProcessing Link icon

      public void stopProcessing()
    • startWait Link icon

      public void startWait()
    • stopWait Link icon

      public void stopWait()
    • batchReceived Link icon

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

      public String getId()
    • getProfile Link icon

      public UserBitShared.OperatorProfile getProfile()
    • addAllMetrics Link icon

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

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

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

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

      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 Link icon

      public long getLongStat(MetricDef metric)
    • addDoubleStat Link icon

      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 Link icon

      public double getDoubleStat(MetricDef metric)
    • setLongStat Link icon

      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 Link icon

      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 Link icon

      public long getWaitNanos()
    • adjustWaitNanos Link icon

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

      public long getProcessingNanos()