Class AbstractOSThread

    • Field Detail

      • cumulativeCpuLoad

        private final java.util.function.Supplier<java.lang.Double> cumulativeCpuLoad
      • owningProcessId

        private final int owningProcessId
    • Constructor Detail

      • AbstractOSThread

        protected AbstractOSThread​(int processId)
    • Method Detail

      • getOwningProcessId

        public int getOwningProcessId()
        Description copied from interface: OSThread
        The owning process of this thread. For single-threaded processes, the owning process ID may be the same as the thread's ID.
        Specified by:
        getOwningProcessId in interface OSThread
        Returns:
        The owning process of this thread.
      • getThreadCpuLoadCumulative

        public double getThreadCpuLoadCumulative()
        Description copied from interface: OSThread
        Gets cumulative CPU usage of this thread.
        Specified by:
        getThreadCpuLoadCumulative in interface OSThread
        Returns:
        The proportion of up time that the thread was executing in kernel or user mode.
      • queryCumulativeCpuLoad

        private double queryCumulativeCpuLoad()
      • getThreadCpuLoadBetweenTicks

        public double getThreadCpuLoadBetweenTicks​(OSThread priorSnapshot)
        Description copied from interface: OSThread
        Gets CPU usage of this thread since a previous snapshot of the same thread, provided as a parameter.
        Specified by:
        getThreadCpuLoadBetweenTicks in interface OSThread
        Parameters:
        priorSnapshot - An OSThread object containing statistics for this same thread collected at a prior point in time. May be null.
        Returns:
        If the prior snapshot is for the same thread at a prior point in time, the proportion of elapsed up time between the current thread snapshot and the previous one that the thread was executing in kernel or user mode. Returns cumulative load otherwise.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object