Class GuestOSProcessorUsage

java.lang.Object
com.ibm.virtualization.management.GuestOSProcessorUsage

public final class GuestOSProcessorUsage extends Object
This provides a snapshot of the Guest (Virtual Machine(VM)/Logical Partition(LPAR)) Processor usage statistics as seen by the Hypervisor Host. The statistics are an aggregate across all physical CPUs assigned to the Guest by the Hypervisor Host. The supported Operating System and Hypervisor combinations are:
  1. Linux and Windows on VMWare (IBM Java 8 only).
  2. AIX and Linux on PowerVM.
  3. Linux and z/OS on z/VM.
  4. Linux on PowerKVM.
Since:
1.7.1
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    Receives a CompositeData representing a GuestOSProcessorUsage object and attempts to return the root GuestOSProcessorUsage instance.
    float
    The total CPU Entitlement assigned to this Guest by the Hypervisor.
    long
    The total used time of the Guest as reported by the Hypervisor in microseconds.
    long
    The the clock speed of the Host Processor in platform-dependent units.
    long
    The timestamp when the usage statistics were last sampled in microseconds.
    Text description of this GuestOSProcessorUsage 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

  • Method Details

    • getCpuTime

      public long getCpuTime()
      The total used time of the Guest as reported by the Hypervisor in microseconds.
      • z/OS maintains CPU usage history only for the last 4 hours. The value might not be monotonically increasing.
      Returns:
      used time in microseconds or -1 if info not available.
    • getHostCpuClockSpeed

      public long getHostCpuClockSpeed()
      The the clock speed of the Host Processor in platform-dependent units.
      • z/OS: Millions of Service Units (MSUs).
      • Linux, AIX, and Windows: MegaHertz (MHz).
      Returns:
      Host CPU clock speed or -1 if not available.
    • getTimestamp

      public long getTimestamp()
      The timestamp when the usage statistics were last sampled in microseconds.
      Returns:
      The last sampling timestamp in microseconds.
    • getCpuEntitlement

      public float getCpuEntitlement()
      The total CPU Entitlement assigned to this Guest by the Hypervisor. The value is in Processor units and could be a fraction.
      • VMWare: CpuLimitMHz, CpuReservationMHz, CpuShares and HostProcessorSpeed are used to arrive at the Entitlement.
      • PowerVM: entitled_proc_capacity/100 on AIX and partition_entitled_capacity/100 on Linux represents the Entitlement.
      • z/VM: CPU Entitlement is unavailable.
      Returns:
      CPU Entitlement assigned for this Guest or -1 if not available.
    • from

      public static GuestOSProcessorUsage from(CompositeData cd)
      Receives a CompositeData representing a GuestOSProcessorUsage object and attempts to return the root GuestOSProcessorUsage instance.
      Parameters:
      cd - A CompositeData that represents a GuestOSProcessorUsage.
      Returns:
      if cd is non- null, returns a new instance of GuestOSProcessorUsage, If cd is null, returns null.
      Throws:
      IllegalArgumentException - if argument cd does not correspond to a GuestOSProcessorUsage with the following attributes:
      • cpuTime(java.lang.Long)
      • timestamp(java.lang.Long)
      • cpuEntitlement(java.lang.Float)
      • hostCpuClockSpeed(java.lang.Long)
    • toString

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