Class ProcessorUsage

java.lang.Object
com.ibm.lang.management.ProcessorUsage

public class ProcessorUsage extends Object
This represents a snapshot of the Operating System level Processor usage statistics. The statistics could be at an individual Processor level or an aggregate across all Processors. The statistics are available on AIX, Linux and Windows.
  • This information is not available on z/OS.
Since:
1.7.1
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new ProcessorUsage instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    Receives a CompositeData representing a ProcessorUsage object and attempts to return the root ProcessorUsage instance.
    long
    The time spent by the Processor executing a non-idle thread in microseconds.
    int
    A unique identifier assigned to the this Processor.
    long
    The time spent by the Processor sitting idle in microseconds.
    int
    The online/offline status of this Processor.
    long
    The time spent in system mode in microseconds.
    long
    The timestamp when usage statistics were last sampled in microseconds.
    long
    The time spent in user mode in microseconds.
    long
    The time spent by the Processor in Input/Output (IO) wait in microseconds.
    Text description of this ProcessorUsage object.

    Methods declared in class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
    Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.
    boolean
    Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    May cause performance issues, deadlocks and hangs.
    final Class<? extends Object>
    Answers the unique instance of java.lang.Class which represents the class of the receiver.
    int
    Answers an integer hash code for the receiver.
    final void
    Causes one thread which is waiting on the receiver to be made ready to run.
    final void
    Causes all threads which are waiting on the receiver to be made ready to run.
    final void
    Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated by notify or notifyAll).
    final void
    wait(long time)
    Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated by notify or notifyAll) or the expiration of the timeout.
    final void
    wait(long time, int frac)
    Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated by notify or notifyAll) or the expiration of the timeout.
  • Constructor Details

    • ProcessorUsage

      public ProcessorUsage()
      Creates a new ProcessorUsage instance.
  • Method Details

    • getUser

      public long getUser()
      The time spent in user mode in microseconds.
      Returns:
      The user times in microseconds or -1 if not available.
    • getSystem

      public long getSystem()
      The time spent in system mode in microseconds.
      Returns:
      The system times in microseconds or -1 if not available.
    • getIdle

      public long getIdle()
      The time spent by the Processor sitting idle in microseconds.
      Returns:
      The idle times in microseconds or -1 if not available.
    • getWait

      public long getWait()
      The time spent by the Processor in Input/Output (IO) wait in microseconds.
      Returns:
      The wait times in microseconds or -1 if not available.
    • getBusy

      public long getBusy()
      The time spent by the Processor executing a non-idle thread in microseconds.
      Returns:
      The busy times in microseconds or -1 if not available.
    • getId

      public int getId()
      A unique identifier assigned to the this Processor. This is -1 if method invoked on the global Processor record.
      Returns:
      An identifier for this Processor or -1 for the global record or if not available.
    • getOnline

      public int getOnline()
      The online/offline status of this Processor. This is -1 if method invoked on the global Processor record or if this info is unavailable.
      • On AIX the online value is not reliable. Once a Processor becomes online, the status of the Processor will always be shown as online from that point onwards, even if it is currently offline. This is a limitation of the OS. Similarly offline on AIX means that the Processor was never online.
      Returns:
      This Processor's online status (0 = offline, 1 = online) or -1 for the global record or if not available.
    • getTimestamp

      public long getTimestamp()
      The timestamp when usage statistics were last sampled in microseconds.
      Returns:
      Timestamp in microseconds.
    • from

      public static ProcessorUsage from(CompositeData cd)
      Receives a CompositeData representing a ProcessorUsage object and attempts to return the root ProcessorUsage instance.
      Parameters:
      cd - A CompositeData that represents a ProcessorUsage
      Returns:
      if cd is non- null, returns a new instance of ProcessorUsage, If cd is null, returns null.
      Throws:
      IllegalArgumentException - if argument cd does not correspond to a ProcessorUsage with the following attributes:
      • user(java.lang.Long)
      • system(java.lang.Long)
      • idle(java.lang.Long)
      • wait(java.lang.Long)
      • busy(java.lang.Long)
      • id(java.lang.Integer)
      • online(java.lang.Integer)
      • timestamp(java.lang.Long)
    • toString

      public String toString()
      Text description of this ProcessorUsage object.
      Overrides:
      toString in class Object
      Returns:
      Text description of this ProcessorUsage object.