Class Profiler

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public final class Profiler
    extends java.lang.Object
    implements java.lang.AutoCloseable
    • 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:
        close in interface java.lang.AutoCloseable
      • getChildren

        public java.util.Collection<Profiler> getChildren()
      • getLock

        public java.lang.Object getLock()