Class QueryPerformanceRecorderImpl
java.lang.Object
io.deephaven.engine.table.impl.perf.QueryPerformanceRecorderImpl
- All Implemented Interfaces:
QueryPerformanceRecorder
Query performance instrumentation implementation. Manages a hierarchy of
QueryPerformanceNugget instances.
Many methods are synchronized to 1) support external abort of query and 2) for scenarios where the query is suspended and resumed on another thread.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.engine.table.impl.perf.QueryPerformanceRecorder
QueryPerformanceRecorder.QueryDataConsumer -
Field Summary
Fields inherited from interface io.deephaven.engine.table.impl.perf.QueryPerformanceRecorder
UNINSTRUMENTED_CODE_DESCRIPTION -
Method Summary
Modifier and TypeMethodDescriptionvoidAbort a query.voidaccumulate(@NotNull QueryPerformanceRecorder subQuery) Accumulate performance information from another recorder into this one.booleanendQuery()End a query.getCompilationNugget(@NotNull String name) Create a nugget at the top of the user stack for a compilation task.This is the nugget enclosing the current operation.Create a nugget at the top of the user stack.This getter should be called by exclusive owners of the recorder, and never concurrently with mutators.getState()Return the query's current statebooleanResumes a suspend query.Starts a query.voidsupplyQueryData(@NotNull QueryPerformanceRecorder.QueryDataConsumer consumer) Provide current query data via the consumer.voidSuspends a query.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.deephaven.engine.table.impl.perf.QueryPerformanceRecorder
getNugget
-
Method Details
-
abortQuery
public void abortQuery()Description copied from interface:QueryPerformanceRecorderAbort a query.A query is
RUNNINGif it has beenstartedorresumedwithout a subsequentend,suspend, or abort.Note that this method is invoked out-of-band and does not throw if the query has been completed.
- Specified by:
abortQueryin interfaceQueryPerformanceRecorder
-
getState
Return the query's current state- Specified by:
getStatein interfaceQueryPerformanceRecorder- Returns:
- the query's state or null if it isn't initialized yet
-
startQuery
Description copied from interface:QueryPerformanceRecorderStarts a query.A query is
RUNNINGif it has been started orresumedwithout a subsequentend,suspend, orabort.- Specified by:
startQueryin interfaceQueryPerformanceRecorder
-
endQuery
public boolean endQuery()Description copied from interface:QueryPerformanceRecorderEnd a query.A query is
RUNNINGif it has beenstartedorresumedwithout a subsequent end,suspend, orabort.- Specified by:
endQueryin interfaceQueryPerformanceRecorder- Returns:
- whether the query should be logged
-
suspendQuery
public void suspendQuery()Suspends a query.This resets the thread local and assumes that this performance nugget may be resumed on another thread.
- Specified by:
suspendQueryin interfaceQueryPerformanceRecorder
-
resumeQuery
Resumes a suspend query.It is an error to resume a query while another query is running on this thread.
- Specified by:
resumeQueryin interfaceQueryPerformanceRecorder- Returns:
- this
-
getNugget
Description copied from interface:QueryPerformanceRecorderCreate a nugget at the top of the user stack. May return aQueryPerformanceNugget.DUMMY_NUGGETif no recorder is installed.- Specified by:
getNuggetin interfaceQueryPerformanceRecorder- Parameters:
name- the nugget nameinputSize- the nugget's input size- Returns:
- A new QueryPerformanceNugget to encapsulate user query operations.
QueryPerformanceNugget.close()must be called on the nugget.
-
getCompilationNugget
Description copied from interface:QueryPerformanceRecorderCreate a nugget at the top of the user stack for a compilation task. May return aQueryPerformanceNugget.DUMMY_NUGGETif no recorder is installed.- Specified by:
getCompilationNuggetin interfaceQueryPerformanceRecorder- Parameters:
name- the nugget name- Returns:
- A new QueryPerformanceNugget to encapsulate the compilation.
QueryPerformanceNugget.close()must be called on the nugget.
-
getEnclosingNugget
Description copied from interface:QueryPerformanceRecorderThis is the nugget enclosing the current operation. It may belong to the dummy recorder, or a real one.- Specified by:
getEnclosingNuggetin interfaceQueryPerformanceRecorder- Returns:
- Either a "catch-all" nugget, or the top of the user nugget stack.
-
supplyQueryData
Description copied from interface:QueryPerformanceRecorderProvide current query data via the consumer.- Specified by:
supplyQueryDatain interfaceQueryPerformanceRecorder- Parameters:
consumer- a callback to receive query data
-
getQueryLevelPerformanceData
- Specified by:
getQueryLevelPerformanceDatain interfaceQueryPerformanceRecorder- Returns:
- the query level performance data
-
getOperationLevelPerformanceData
Description copied from interface:QueryPerformanceRecorderThis getter should be called by exclusive owners of the recorder, and never concurrently with mutators.- Specified by:
getOperationLevelPerformanceDatain interfaceQueryPerformanceRecorder- Returns:
- A list of loggable operation performance data.
-
accumulate
Description copied from interface:QueryPerformanceRecorderAccumulate performance information from another recorder into this one. The provided recorder will not be mutated.- Specified by:
accumulatein interfaceQueryPerformanceRecorder- Parameters:
subQuery- the recorder to accumulate into this
-
hasSubQueries
public boolean hasSubQueries()- Specified by:
hasSubQueriesin interfaceQueryPerformanceRecorder- Returns:
- whether a sub-query was ever accumulated into this recorder
-