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
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedQueryPerformanceNugget(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 TypeMethodDescriptionvoidabort()voidclose()Mark this nuggetQueryState.FINISHEDand notify the recorder.intgetDepth()longlonglonglonglonglonglonglonglongintlongint@Nullable StringlongbooleanbooleanbooleanbooleanbooleanisUser()voidvoidStart clock epoch nanos is set if this is the first time this nugget has been started.toString()booleanMethods 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_LONGif noneoperationNumber- A unique identifier for the operation within a query evaluationparentOperationNumber- The unique identifier of the parent operation orQueryConstants.NULL_INTif 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:
onBaseEntryStartin classBasePerformanceEntry
-
onBaseEntryEnd
public void onBaseEntryEnd()- Overrides:
onBaseEntryEndin classBasePerformanceEntry
-
close
public void close()Mark this nuggetQueryState.FINISHEDand notify the recorder.SafeCloseableimplementation for try-with-resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSafeCloseable
-
abort
public void abort() -
toString
-
append
- Specified by:
appendin interfaceLogOutputAppendable- Overrides:
appendin 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
AuthContextthat 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.
-