public class OperatorStats extends Object
Modifier and Type | Field and Description |
---|---|
long[] |
batchesReceivedByInput |
protected int |
operatorId |
protected String |
operatorType |
protected long |
processingNanos |
long[] |
recordsReceivedByInput |
protected long |
setupNanos |
protected long |
waitNanos |
Constructor and Description |
---|
OperatorStats(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 threads
|
OperatorStats(OpProfileDef def,
BufferAllocator allocator) |
Modifier and Type | Method and Description |
---|---|
void |
addAllMetrics(UserBitShared.OperatorProfile.Builder builder) |
void |
addDoubleMetrics(UserBitShared.OperatorProfile.Builder builder) |
void |
addDoubleStat(MetricDef metric,
double value)
Add a double value to the existing value.
|
void |
addLongMetrics(UserBitShared.OperatorProfile.Builder builder) |
void |
addLongStat(MetricDef metric,
long value)
Set a stat to the specified long value.
|
void |
addStreamProfile(UserBitShared.OperatorProfile.Builder builder) |
void |
adjustWaitNanos(long waitNanosOffset)
Adjust waitNanos based on client calculations
|
void |
batchReceived(int inputIndex,
long records,
boolean newSchema) |
void |
clear()
Clear stats
|
double |
getDoubleStat(MetricDef metric) |
String |
getId() |
long |
getLongStat(MetricDef metric) |
long |
getProcessingNanos() |
UserBitShared.OperatorProfile |
getProfile() |
long |
getWaitNanos() |
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
|
void |
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 |
startProcessing() |
void |
startSetup() |
void |
startWait() |
void |
stopProcessing() |
void |
stopSetup() |
void |
stopWait() |
protected final int operatorId
protected final String operatorType
public long[] recordsReceivedByInput
public long[] batchesReceivedByInput
protected long processingNanos
protected long setupNanos
protected long waitNanos
public OperatorStats(OpProfileDef def, BufferAllocator allocator)
public OperatorStats(OperatorStats original, boolean isClean)
original
- - OperatorStats object to create a copy fromisClean
- - flag to indicate whether to start with clean state indicators or inherit those from original objectpublic OperatorStats(int operatorId, String operatorType, int inputCount, BufferAllocator allocator)
public OperatorStats mergeMetrics(OperatorStats from)
from
- - OperatorStats from where to merge to "this"public void clear()
public void startSetup()
public void stopSetup()
public void startProcessing()
public void stopProcessing()
public void startWait()
public void stopWait()
public void batchReceived(int inputIndex, long records, boolean newSchema)
public String getId()
public UserBitShared.OperatorProfile getProfile()
public void addAllMetrics(UserBitShared.OperatorProfile.Builder builder)
public void addStreamProfile(UserBitShared.OperatorProfile.Builder builder)
public void addLongMetrics(UserBitShared.OperatorProfile.Builder builder)
public void addDoubleMetrics(UserBitShared.OperatorProfile.Builder builder)
public void addLongStat(MetricDef metric, long value)
metric
- the metric to updatevalue
- the value to setpublic long getLongStat(MetricDef metric)
public void addDoubleStat(MetricDef metric, double value)
metric
- the metric to updatevalue
- the value to add to the existing valuepublic double getDoubleStat(MetricDef metric)
public void setLongStat(MetricDef metric, long value)
metric
- the metric to updatevalue
- the value to add to the existing valuepublic void setDoubleStat(MetricDef metric, double value)
metric
- the metric to updatevalue
- the value to setpublic long getWaitNanos()
public void adjustWaitNanos(long waitNanosOffset)
waitNanosOffset
- - could be negative as well as positivepublic long getProcessingNanos()
Copyright © 1970 The Apache Software Foundation. All rights reserved.