org.ow2.jasmine.vmm.api
Class ResourceUsage

java.lang.Object
  extended by org.ow2.jasmine.vmm.api.ResourceUsage
All Implemented Interfaces:
java.io.Serializable

public class ResourceUsage
extends java.lang.Object
implements java.io.Serializable

A snapshot of performance metrics for a virtual machine

See Also:
Serialized Form

Nested Class Summary
static class ResourceUsage.DiskStats
          Disk I/O performance metrics of a device
static class ResourceUsage.NetworkStats
          Network I/O performance metrics of a NIC
 
Constructor Summary
ResourceUsage()
          Constructs a new ResourceUsage
 
Method Summary
static ResourceUsage from(javax.management.openmbean.CompositeData cd)
          Constructs a new ResourceUsage from a CompositeDate object
 float getCpuLoad()
          Returns the CPU load of the VM as the fraction of of the physical CPU capacity
 java.util.List<ResourceUsage.DiskStats> getDiskStats()
          Returns the the disk I/O performance statistics of all disk devices attached to the VM
 long getMemoryUsedKBytes()
          Returns the memory occupation of the VM in kilobytes
 java.util.List<ResourceUsage.NetworkStats> getNetworkStats()
          Returns the network performance statistics of all NICs attached to the VM
 java.util.Date getSamplingTime()
          Returns the time at which the ResourceUsage was sampled
 void setCpuLoad(float cpuLoad)
          Sets the CPU load of the VM as the fraction of of the physical CPU capacity
 void setDiskStats(java.util.List<ResourceUsage.DiskStats> diskStats)
          Sets the disk I/O performance statistics of all disk devices attached to the VM
 void setMemoryUsedKBytes(long memoryUsedKBytes)
          Sets the memory occupation of the VM in kilobytes
 void setNetworkStats(java.util.List<ResourceUsage.NetworkStats> networkStats)
          Sets the network performance statistics of all NICs attached to the VM
 void setSamplingTime(java.util.Date samplingTime)
          Sets the time at which the ResourceUsage is sampled
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceUsage

public ResourceUsage()
Constructs a new ResourceUsage

Method Detail

from

public static ResourceUsage from(javax.management.openmbean.CompositeData cd)
Constructs a new ResourceUsage from a CompositeDate object

Parameters:
cd - composite data representing a ResourceUsage
Returns:
a ResourceUsage object represented by cd

getSamplingTime

public java.util.Date getSamplingTime()
Returns the time at which the ResourceUsage was sampled

Returns:
the time at which the ResourceUsage was sampled

getCpuLoad

public float getCpuLoad()
Returns the CPU load of the VM as the fraction of of the physical CPU capacity

Returns:
the CPU load (between 0 and 1)

getMemoryUsedKBytes

public long getMemoryUsedKBytes()
Returns the memory occupation of the VM in kilobytes

Returns:
memory occupation of the VM in kilobytes

getNetworkStats

public java.util.List<ResourceUsage.NetworkStats> getNetworkStats()
Returns the network performance statistics of all NICs attached to the VM

Returns:
list of NetworkStats representing the network performance of all NICs attached to the VM

getDiskStats

public java.util.List<ResourceUsage.DiskStats> getDiskStats()
Returns the the disk I/O performance statistics of all disk devices attached to the VM

Returns:
the disk I/O performance statistics of all disk devices attached to the VM

setSamplingTime

public void setSamplingTime(java.util.Date samplingTime)
Sets the time at which the ResourceUsage is sampled

Parameters:
samplingTime - time at which the ResourceUsage is sampled

setCpuLoad

public void setCpuLoad(float cpuLoad)
Sets the CPU load of the VM as the fraction of of the physical CPU capacity

Parameters:
cpuLoad - the CPU load

setMemoryUsedKBytes

public void setMemoryUsedKBytes(long memoryUsedKBytes)
Sets the memory occupation of the VM in kilobytes

Parameters:
memoryUsedKBytes - memory occupation of the VM in kilobytes

setNetworkStats

public void setNetworkStats(java.util.List<ResourceUsage.NetworkStats> networkStats)
Sets the network performance statistics of all NICs attached to the VM

Parameters:
networkStats - list of NetworkStats representing the network performance of all NICs attached to the VM

setDiskStats

public void setDiskStats(java.util.List<ResourceUsage.DiskStats> diskStats)
Sets the disk I/O performance statistics of all disk devices attached to the VM

Parameters:
diskStats - list of DiskStats representing the disk I/O performance of all disk devices attached to the VM

toString

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


Copyright © 2009 OW2 Consortium. All Rights Reserved.