Rio Project 4.2 API Documentation



org.rioproject.system
Class ComputeResourceUtilization

java.lang.Object
  extended by org.rioproject.system.ComputeResourceUtilization
All Implemented Interfaces:
Serializable, Comparable

public class ComputeResourceUtilization
extends Object
implements Comparable, Serializable

The ComputeResourceUtilization provides a mechanism to represent the utilization of a ComputeResource. ComputeResource quantitative behavior is represented by MeasuredResource objects. Each MeasuredResource contains a relative value which represents the percentage of the resource being measured. This value is the relative utilization of the resource's usage. The summation of a compute resource's utilization is represented by the utilization property.

Author:
Dennis Reedy
See Also:
Serialized Form

Constructor Summary
ComputeResourceUtilization(String description, String hostName, String address, Collection<MeasuredResource> mRes)
          Construct a ComputeResourceUtilization
ComputeResourceUtilization(String description, String hostName, String address, Double utilization, Collection<MeasuredResource> mRes)
          Construct a ComputeResourceUtilization
 
Method Summary
 int compareTo(Object o)
          Compares this ComputeResourceUtilization object with another ComputeResourceUtilization object for order using the computed utilization of the ComputeResourceUtilization
 String getAddress()
          Get the address the compute resource is bound to
 CpuUtilization getCpuUtilization()
          Get the measured CPU utilization
 String getDescription()
          Get the description
 DiskSpaceUtilization getDiskSpaceUtilization()
          Get the measured disk space utilization
 String getHostName()
          Get the hostname
 Collection<MeasuredResource> getMeasuredResources()
          The Map of measurable capability utilization values
 ProcessCpuUtilization getProcessCpuUtilization()
          Get the measured process cpu utilization
 ProcessMemoryUtilization getProcessMemoryUtilization()
          Get the measured process memory utilization
 SystemMemoryUtilization getSystemMemoryUtilization()
          Get the measured system memory utilization
 Double getUtilization()
          Get the utilization value, a summation of the measured resources
 boolean measuredResourcesWithinRange()
          Determine if the ComputeResourceUtilization contains MeasuredResource instances that have values which fall outside of their threshold declaration
 void setAddress(String address)
          Set the address the compute resource is bound to
 void setDescription(String description)
          Set the description
 void setHostName(String hostName)
          Set the hostname
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComputeResourceUtilization

public ComputeResourceUtilization(String description,
                                  String hostName,
                                  String address,
                                  Collection<MeasuredResource> mRes)
Construct a ComputeResourceUtilization

Parameters:
description - A description for the resource
hostName - The host name of the ComputeResource
address - IP address of the ComputeResource
mRes - Collection of MeasuredResources, corresponding to whats being measured on the compute resource

ComputeResourceUtilization

public ComputeResourceUtilization(String description,
                                  String hostName,
                                  String address,
                                  Double utilization,
                                  Collection<MeasuredResource> mRes)
Construct a ComputeResourceUtilization

Parameters:
description - A description for the resource
hostName - The host name of the ComputeResource
address - IP address of the ComputeResource
utilization - Composite utilization of the ComputeResource
mRes - Collection of MeasuredResources, corresponding to whats being measured on the compute resource
Method Detail

getDescription

public String getDescription()
Get the description

Returns:
The description

setDescription

public void setDescription(String description)
Set the description

Parameters:
description - The description

getHostName

public String getHostName()
Get the hostname

Returns:
The hostname

setHostName

public void setHostName(String hostName)
Set the hostname

Parameters:
hostName - The hostname

getAddress

public String getAddress()
Get the address the compute resource is bound to

Returns:
The host address

setAddress

public void setAddress(String address)
Set the address the compute resource is bound to

Parameters:
address - The address the compute resource is bound to

getUtilization

public Double getUtilization()
Get the utilization value, a summation of the measured resources

Returns:
The utilization value

getMeasuredResources

public Collection<MeasuredResource> getMeasuredResources()
The Map of measurable capability utilization values

Returns:
The Map of measurable capability utilization values

getCpuUtilization

public CpuUtilization getCpuUtilization()
Get the measured CPU utilization

Returns:
The latest CpuUtilization taken from the compute resource. If not available, return null.

getSystemMemoryUtilization

public SystemMemoryUtilization getSystemMemoryUtilization()
Get the measured system memory utilization

Returns:
The latest SystemMemoryUtilization taken from the compute resource. If not available, return null.

getProcessMemoryUtilization

public ProcessMemoryUtilization getProcessMemoryUtilization()
Get the measured process memory utilization

Returns:
The latest ProcessMemoryUtilization taken from the compute resource. If not available, return null.

getProcessCpuUtilization

public ProcessCpuUtilization getProcessCpuUtilization()
Get the measured process cpu utilization

Returns:
The latest ProcessCpuUtilization taken from the compute resource. If not available, return null.

getDiskSpaceUtilization

public DiskSpaceUtilization getDiskSpaceUtilization()
Get the measured disk space utilization

Returns:
The latest DiskSpaceUtilization taken from the compute resource. If not available, return null.

measuredResourcesWithinRange

public boolean measuredResourcesWithinRange()
Determine if the ComputeResourceUtilization contains MeasuredResource instances that have values which fall outside of their threshold declaration

Returns:
True if all MeasuredResource instances are within their known threshold range. If any of the MeasuredResource instances have a value which falls outside of their threshold declaration, return false;

compareTo

public int compareTo(Object o)
Compares this ComputeResourceUtilization object with another ComputeResourceUtilization object for order using the computed utilization of the ComputeResourceUtilization

Specified by:
compareTo in interface Comparable
Parameters:
o - Object to compare to

toString

public String toString()
Overrides:
toString in class Object

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.