Class QueryPerformanceNugget
java.lang.Object
io.deephaven.engine.table.impl.perf.BasePerformanceEntry
io.deephaven.engine.table.impl.perf.QueryPerformanceNugget
- All Implemented Interfaces:
LogOutputAppendable
,SafeCloseable
,AutoCloseable
Per-operation instrumentation node for hierarchical performance recording. Note that this class has an unusually
intimate relationship with another class,
QueryPerformanceRecorder
. Changes to either should take this lack
of encapsulation into account.-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
QueryPerformanceNugget
(long evaluationNumber, long parentEvaluationNumber, int operationNumber, int parentOperationNumber, int depth, @NotNull String description, @Nullable String sessionId, boolean isUser, boolean isCompilation, long inputSize, @NotNull Consumer<QueryPerformanceNugget> onCloseCallback) Full constructor for nuggets. -
Method Summary
Modifier and TypeMethodDescriptionvoid
abort()
void
close()
Mark this nuggetQueryState.FINISHED
and notify the recorder.int
getDepth()
long
long
long
long
long
long
long
long
long
int
long
int
@Nullable String
long
boolean
boolean
boolean
boolean
boolean
isUser()
void
void
Start clock epoch nanos is set if this is the first time this nugget has been started.toString()
boolean
Methods inherited from class io.deephaven.engine.table.impl.perf.BasePerformanceEntry
accumulate, getAllocatedBytes, getCpuNanos, getPoolAllocatedBytes, getUsageNanos, getUserCpuNanos
-
Field Details
-
DEFAULT_FACTORY
-
-
Constructor Details
-
QueryPerformanceNugget
protected QueryPerformanceNugget(long evaluationNumber, long parentEvaluationNumber, int operationNumber, int parentOperationNumber, int depth, @NotNull @NotNull String description, @Nullable @Nullable String sessionId, boolean isUser, boolean isCompilation, long inputSize, @NotNull @NotNull Consumer<QueryPerformanceNugget> onCloseCallback) Full constructor for nuggets.- Parameters:
evaluationNumber
- A unique identifier for the query evaluation that triggered this nugget creationparentEvaluationNumber
- The unique identifier of the parent evaluation orQueryConstants.NULL_LONG
if noneoperationNumber
- A unique identifier for the operation within a query evaluationparentOperationNumber
- The unique identifier of the parent operation orQueryConstants.NULL_INT
if nonedepth
- Depth in the evaluation chain for the respective operationdescription
- The operation descriptionisUser
- Whether this is a "user" nugget or one created by the systemisCompilation
- Whether this is a compilation nuggetinputSize
- The size of the input dataonCloseCallback
- A callback that is invoked when the nugget is closed. It returns whether the nugget should be logged.
-
-
Method Details
-
onBaseEntryStart
public void onBaseEntryStart()Start clock epoch nanos is set if this is the first time this nugget has been started.- Overrides:
onBaseEntryStart
in classBasePerformanceEntry
-
onBaseEntryEnd
public void onBaseEntryEnd()- Overrides:
onBaseEntryEnd
in classBasePerformanceEntry
-
close
public void close()Mark this nuggetQueryState.FINISHED
and notify the recorder.SafeCloseable
implementation for try-with-resources.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSafeCloseable
-
abort
public void abort() -
toString
-
append
- Specified by:
append
in interfaceLogOutputAppendable
- Overrides:
append
in classBasePerformanceEntry
-
getEvaluationNumber
public long getEvaluationNumber() -
getParentEvaluationNumber
public long getParentEvaluationNumber() -
getOperationNumber
public int getOperationNumber() -
getParentOperationNumber
public int getParentOperationNumber() -
getDepth
public int getDepth() -
getDescription
-
getSessionId
-
isUser
public boolean isUser() -
isCompilation
public boolean isCompilation() -
isQueryLevel
public boolean isQueryLevel() -
isTopLevelQuery
public boolean isTopLevelQuery() -
isTopLevelOperation
public boolean isTopLevelOperation() -
getInputSize
public long getInputSize() -
getAuthContext
- Returns:
- The
AuthContext
that was installed when this QueryPerformanceNugget was constructed
-
getCallerLine
-
getStartClockEpochNanos
public long getStartClockEpochNanos()- Returns:
- wall clock start time in nanoseconds from the epoch
-
getEndClockEpochNanos
public long getEndClockEpochNanos()- Returns:
- wall clock end time in nanoseconds from the epoch
-
getEndFreeMemory
public long getEndFreeMemory()- Returns:
- free memory at completion
-
getEndTotalMemory
public long getEndTotalMemory()- Returns:
- total memory used at completion
-
getDiffFreeMemory
public long getDiffFreeMemory()- Returns:
- free memory difference between time of completion and creation
-
getDiffTotalMemory
public long getDiffTotalMemory()- Returns:
- total (allocated high watermark) memory difference between time of completion and creation
-
getDiffCollections
public long getDiffCollections()- Returns:
- Number of garbage collections between time of completion and creation
-
getDiffCollectionTimeNanos
public long getDiffCollectionTimeNanos()- Returns:
- Time spent in garbage collection, in milliseconds, between time of completion and creation
-
wasInterrupted
public boolean wasInterrupted()- Returns:
- true if this nugget was interrupted by an abort() call.
-