public class OperatorStats extends Object implements OperatorStatReceiver
| Modifier and Type | Field and Description |
|---|---|
long[] |
batchesReceivedByInput |
protected int |
operatorId |
protected int |
operatorType |
protected long |
processingNanos |
long[] |
recordsReceivedByInput |
protected long |
setupNanos |
protected long |
waitNanos |
| Constructor and Description |
|---|
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)
Add a long value to the existing 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
|
String |
getId() |
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)
Set a stat to the specified long value.
|
void |
startProcessing() |
void |
startSetup() |
void |
startWait() |
void |
stopProcessing() |
void |
stopSetup() |
void |
stopWait() |
protected final int operatorId
protected final int 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 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()
startWait in interface OperatorStatReceiverpublic void stopWait()
stopWait in interface OperatorStatReceiverpublic 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)
OperatorStatReceiveraddLongStat in interface OperatorStatReceivermetric - the metric to updatevalue - the value to add to the existing valuepublic void addDoubleStat(MetricDef metric, double value)
OperatorStatReceiveraddDoubleStat in interface OperatorStatReceivermetric - the metric to updatevalue - the value to add to the existing valuepublic void setLongStat(MetricDef metric, long value)
OperatorStatReceiversetLongStat in interface OperatorStatReceivermetric - the metric to updatevalue - the value to setpublic void setDoubleStat(MetricDef metric, double value)
OperatorStatReceiversetDoubleStat in interface OperatorStatReceivermetric - 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 © 2017 The Apache Software Foundation. All rights reserved.