Package org.apache.drill.exec.ops
Class OperatorStats
java.lang.Object
org.apache.drill.exec.ops.OperatorStats
-
Field Summary
Modifier and TypeFieldDescriptionlong[]
protected final int
protected final String
protected long
long[]
protected long
protected long
-
Constructor Summary
ConstructorDescriptionOperatorStats
(int operatorId, String operatorType, int inputCount, BufferAllocator allocator) 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 threadsOperatorStats
(OpProfileDef def, BufferAllocator allocator) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
addDoubleStat
(MetricDef metric, double value) Add a double value to the existing value.void
void
addLongStat
(MetricDef metric, long value) Set a stat to the specified long value.void
void
adjustWaitNanos
(long waitNanosOffset) Adjust waitNanos based on client calculationsvoid
batchReceived
(int inputIndex, long records, boolean newSchema) void
clear()
Clear statsdouble
getDoubleStat
(MetricDef metric) getId()
long
getLongStat
(MetricDef metric) long
long
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 addedvoid
setDoubleStat
(MetricDef metric, double value) Set a stat to the specified double value.void
setLongStat
(MetricDef metric, long value) Add a long value to the existing value.void
void
void
void
void
void
stopWait()
-
Field Details
-
operatorId
protected final int operatorId -
operatorType
-
recordsReceivedByInput
public long[] recordsReceivedByInput -
batchesReceivedByInput
public long[] batchesReceivedByInput -
processingNanos
protected long processingNanos -
setupNanos
protected long setupNanos -
waitNanos
protected long waitNanos
-
-
Constructor Details
-
OperatorStats
-
OperatorStats
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 fromisClean
- - 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
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
-
getProfile
-
addLongStat
Set a stat to the specified long value. Creates the stat if the stat does not yet exist.- Parameters:
metric
- the metric to updatevalue
- the value to set
-
getLongStat
-
addDoubleStat
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 updatevalue
- the value to add to the existing value
-
getDoubleStat
-
setLongStat
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 updatevalue
- the value to add to the existing value
-
setDoubleStat
Set a stat to the specified double value. Creates the stat if the stat does not yet exist.- Parameters:
metric
- the metric to updatevalue
- 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()
-