Package io.manebot.virtual
Class Profiler
- java.lang.Object
-
- io.manebot.virtual.Profiler
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public final class Profiler extends java.lang.Object implements java.lang.AutoCloseable
-
-
Method Summary
Modifier and Type Method Description voidclose()java.util.Map<java.lang.String,Profiler>get()static Profilerget(java.lang.Thread thread)ProfilergetChild(java.lang.String name)longgetChildActiveNanoseconds()Gets the profiler's child active nanoseconds.longgetChildActiveNanoseconds(long since)Gets the profiler's child active nanoseconds.doublegetChildActiveRatio()Gets the profiler's child active ratio.doublegetChildActiveRatio(long since)Gets the profiler's child active ratio.doublegetChildNanosecondsPerExecution()Gets the average active time, in nanoseconds, per execution, excluding own time.doublegetChildNanosecondsPerExecution(long since)Gets the average active time, in nanoseconds, per execution, excluding own time.java.util.Collection<Profiler>getChildren()longgetExecutions()Gets the total count of executions this profiler is processng.doublegetExecutionsPerNanosecond()Gets the count of executions/sec of this profiler.doublegetExecutionsPerNanosecond(long since)Gets the count of executions/sec of this profiler.longgetLifetimeNanoseconds()Gets the total lifetime of this profiler, in nanoseconds.longgetLifetimeNanoseconds(long since)Gets the total lifetime of this profiler, in nanoseconds.java.lang.ObjectgetLock()java.lang.StringgetName()ProfilergetOrCreateChild(java.lang.String name)Gets a child by name.longgetOwnActiveNanoseconds()Gets the profiler's own total active nanoseconds.longgetOwnActiveNanoseconds(long since)Gets the profiler's own total active nanoseconds.doublegetOwnActiveRatio()Gets the profiler's own active ratio.doublegetOwnActiveRatio(long since)Gets the profiler's own active ratio.doublegetOwnNanosecondsPerExecution()Gets the average active time, in nanoseconds, per execution, excluding child time.doublegetOwnNanosecondsPerExecution(long since)Gets the average active time, in nanoseconds, per execution, excluding child time.ProfilergetParent()doublegetParentActiveRatio()Gets the ratio of this profiler region compared to the parent.doublegetParentActiveRatio(long since)Gets the ratio of this profiler region compared to the parent.longgetTotalActiveNanoseconds()longgetTotalActiveNanoseconds(long since)Gets the profiler's total active nanoseconds.doublegetTotalActiveRatio()Gets the profiler's total active ratio.doublegetTotalActiveRatio(long since)Gets the profiler's total active ratio.doublegetTotalNanosecondsPerExecution()Gets the average active time, in nanoseconds, per execution, including child time.doublegetTotalNanosecondsPerExecution(long since)Gets the average active time, in nanoseconds, per execution, including child time.booleanisRunning()static Profilerregion(java.lang.String name)
-
-
-
Constructor Detail
-
Profiler
public Profiler(java.lang.String name, Profiler parent)
-
-
Method Detail
-
get
public static final Profiler get(java.lang.Thread thread)
-
region
public static final Profiler region(java.lang.String name)
-
getName
public java.lang.String getName()
-
isRunning
public boolean isRunning()
-
getParent
public Profiler getParent()
-
getExecutions
public long getExecutions()
Gets the total count of executions this profiler is processng.
-
getTotalActiveNanoseconds
public long getTotalActiveNanoseconds()
-
getTotalActiveNanoseconds
public long getTotalActiveNanoseconds(long since)
Gets the profiler's total active nanoseconds. This includes child time.
-
getChildActiveNanoseconds
public long getChildActiveNanoseconds()
Gets the profiler's child active nanoseconds. This excludes own time.
-
getChildActiveNanoseconds
public long getChildActiveNanoseconds(long since)
Gets the profiler's child active nanoseconds. This excludes own time.
-
getOwnActiveNanoseconds
public long getOwnActiveNanoseconds()
Gets the profiler's own total active nanoseconds. This excludes child time.
-
getOwnActiveNanoseconds
public long getOwnActiveNanoseconds(long since)
Gets the profiler's own total active nanoseconds. This excludes child time.
-
getLifetimeNanoseconds
public long getLifetimeNanoseconds()
Gets the total lifetime of this profiler, in nanoseconds.
-
getLifetimeNanoseconds
public long getLifetimeNanoseconds(long since)
Gets the total lifetime of this profiler, in nanoseconds.
-
getParentActiveRatio
public double getParentActiveRatio()
Gets the ratio of this profiler region compared to the parent. 0.2: 20% of time of the parent's time was spent in this profiler
-
getParentActiveRatio
public double getParentActiveRatio(long since)
Gets the ratio of this profiler region compared to the parent. 0.2: 20% of time of the parent's time was spent in this profiler
-
getOwnActiveRatio
public double getOwnActiveRatio()
Gets the profiler's own active ratio. This ratio excludes child processing.- Returns:
- Own active ratio
-
getOwnActiveRatio
public double getOwnActiveRatio(long since)
Gets the profiler's own active ratio. This ratio excludes child processing.- Returns:
- Own active ratio
-
getTotalActiveRatio
public double getTotalActiveRatio()
Gets the profiler's total active ratio. This ratio includes child processing.
-
getTotalActiveRatio
public double getTotalActiveRatio(long since)
Gets the profiler's total active ratio. This ratio includes child processing.
-
getChildActiveRatio
public double getChildActiveRatio()
Gets the profiler's child active ratio. This ratio excludes own processing.
-
getChildActiveRatio
public double getChildActiveRatio(long since)
Gets the profiler's child active ratio. This ratio excludes own processing.
-
getTotalNanosecondsPerExecution
public double getTotalNanosecondsPerExecution()
Gets the average active time, in nanoseconds, per execution, including child time.
-
getTotalNanosecondsPerExecution
public double getTotalNanosecondsPerExecution(long since)
Gets the average active time, in nanoseconds, per execution, including child time.
-
getOwnNanosecondsPerExecution
public double getOwnNanosecondsPerExecution()
Gets the average active time, in nanoseconds, per execution, excluding child time.
-
getOwnNanosecondsPerExecution
public double getOwnNanosecondsPerExecution(long since)
Gets the average active time, in nanoseconds, per execution, excluding child time.
-
getChildNanosecondsPerExecution
public double getChildNanosecondsPerExecution()
Gets the average active time, in nanoseconds, per execution, excluding own time.
-
getChildNanosecondsPerExecution
public double getChildNanosecondsPerExecution(long since)
Gets the average active time, in nanoseconds, per execution, excluding own time.
-
getExecutionsPerNanosecond
public double getExecutionsPerNanosecond()
Gets the count of executions/sec of this profiler.- Returns:
- executions/sec
-
getExecutionsPerNanosecond
public double getExecutionsPerNanosecond(long since)
Gets the count of executions/sec of this profiler.- Returns:
- executions/sec
-
getOrCreateChild
public Profiler getOrCreateChild(java.lang.String name)
Gets a child by name.- Parameters:
name- Profiler name.- Returns:
- Profiler child instance.
-
getChild
public Profiler getChild(java.lang.String name)
-
get
public java.util.Map<java.lang.String,Profiler> get()
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable
-
getChildren
public java.util.Collection<Profiler> getChildren()
-
getLock
public java.lang.Object getLock()
-
-