Package com.illumon.iris.db.tables.utils
Class QueryPerformanceNugget
java.lang.Object
com.illumon.iris.db.tables.utils.QueryPerformanceNugget
- All Implemented Interfaces:
Serializable,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.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidabort(QueryPerformanceRecorder recorder) voidaddSubEntry(UpdatePerformanceTracker.SubEntry subEntry) When we track data from other threads that should be attributed to this operation, we tack extra SubEntry values onto this nugget when it is closed.voidclose()AutoCloseable implementation - wraps the no-argument version of done() used by query code outside of the QueryPerformance(Recorder/Nugget), reporting successful completion to the thread-local QueryPerformanceRecorder instance.voiddone()booleandone(QueryPerformanceRecorder recorder) Mark this nuggetQueryState.FINISHEDand notify the recorder.longGet bytes of allocated memory attributed to the instrumented operation.doubledoublelongGet nanoseconds of CPU time attributed to the instrumented operation.longlonglonglonglonglonggetName()longGet bytes of allocated pooled/reusable memory attributed to the instrumented operation.longlonglongGet nanoseconds of user mode CPU time attributed to the instrumented operation.booleanbooleanisUser()toString()boolean
-
Method Details
-
done
public void done() -
done
Mark this nuggetQueryState.FINISHEDand notify the recorder.- Parameters:
recorder- The recorder to notify- Returns:
- if the nugget passes logging thresholds.
-
close
public void close()AutoCloseable implementation - wraps the no-argument version of done() used by query code outside of the QueryPerformance(Recorder/Nugget), reporting successful completion to the thread-local QueryPerformanceRecorder instance.- Specified by:
closein interfaceAutoCloseable
-
abort
-
toString
-
getName
-
isUser
public boolean isUser() -
isTopLevel
public boolean isTopLevel() -
getInputSize
public long getInputSize() -
getCallerLine
-
getTotalTime
- Returns:
- nanoseconds elapsed, once state != QueryState.RUNNING() has been called.
-
getStartClockTime
public long getStartClockTime()- Returns:
- wall clock time in milliseconds from the epoch
-
getCpuNanos
public long getCpuNanos()Get nanoseconds of CPU time attributed to the instrumented operation.- Returns:
- The nanoseconds of CPU time attributed to the instrumented operation, or
QueryConstants.NULL_LONGif not enabled/supported.
-
getUserCpuNanos
public long getUserCpuNanos()Get nanoseconds of user mode CPU time attributed to the instrumented operation.- Returns:
- The nanoseconds of user mode CPU time attributed to the instrumented operation, or
QueryConstants.NULL_LONGif not enabled/supported.
-
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 water mark) memory difference between time of completion and creation
-
getAllocatedBytes
public long getAllocatedBytes()Get bytes of allocated memory attributed to the instrumented operation.- Returns:
- The bytes of allocated memory attributed to the instrumented operation, or
QueryConstants.NULL_LONGif not enabled/supported.
-
getPoolAllocatedBytes
public long getPoolAllocatedBytes()Get bytes of allocated pooled/reusable memory attributed to the instrumented operation.- Returns:
- The bytes of allocated pooled/reusable memory attributed to the instrumented operation, or
QueryConstants.NULL_LONGif not enabled/supported.
-
getFirstTimeDataReads
public long getFirstTimeDataReads()- Returns:
- number of first time data reads that occurred during this query
-
getAverageFirstTimeDataReadTime
public double getAverageFirstTimeDataReadTime()- Returns:
- average first time data read duration in nanos
-
getRepeatedDataReads
public long getRepeatedDataReads()- Returns:
- number of repeated data reads that occurred during this query
-
getAverageRepeatedDataReadTime
public double getAverageRepeatedDataReadTime()- Returns:
- average repeated data read duration in nanos
-
wasInterrupted
public boolean wasInterrupted()- Returns:
- true if this nugget was interrupted by an abort() call.
-
addSubEntry
When we track data from other threads that should be attributed to this operation, we tack extra SubEntry values onto this nugget when it is closed. The CPU time, reads, and allocations are counted against this nugget. Wall clock time is ignored.
-