Rio Project 4.2 API Documentation



org.rioproject.system.measurable.cpu
Class CpuUtilization

java.lang.Object
  extended by org.rioproject.system.MeasuredResource
      extended by org.rioproject.system.measurable.cpu.CpuUtilization
All Implemented Interfaces:
Serializable

public class CpuUtilization
extends MeasuredResource
implements Serializable

Measured system CPU utilization

See Also:
Serialized Form

Constructor Summary
CpuUtilization(String identifier, double system, double user, double[] load, int availableProcessors, ThresholdValues tVals)
          Construct a CpuUtilization with parameters
CpuUtilization(String identifier, double total, ThresholdValues tVals)
          Construct a CpuUtilization with parameters
 
Method Summary
 int getAvailableProcessors()
          Get the number of processors on the machine
 double[] getLoad()
          Get the system load
 double getSystem()
          Get the cpu kernel usage
 double getTotal()
          Get the cpu utilization
 double getUser()
          Get the cpu user usage
 String toString()
           
 
Methods inherited from class org.rioproject.system.MeasuredResource
equals, evaluate, getIdentifier, getThresholdValues, getValue, hashCode, thresholdCrossed
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CpuUtilization

public CpuUtilization(String identifier,
                      double total,
                      ThresholdValues tVals)
Construct a CpuUtilization with parameters

Parameters:
identifier - Identifier for the CpuUtilization
total - The total system cpu utilization
tVals - ThresholdValues for the CpuUtilization

CpuUtilization

public CpuUtilization(String identifier,
                      double system,
                      double user,
                      double[] load,
                      int availableProcessors,
                      ThresholdValues tVals)
Construct a CpuUtilization with parameters

Parameters:
identifier - Identifier for the CpuUtilization
system - The cpu kernel usage
user - The cpu user usage
load - The system load average
availableProcessors - The number of available processors on the machine
tVals - ThresholdValues for the CpuUtilization
Method Detail

getSystem

public double getSystem()
Get the cpu kernel usage

Returns:
The cpu kernel use as a percentage; or a Double.NaN if not available.

getUser

public double getUser()
Get the cpu user usage

Returns:
The cpu user use as a percentage; or a Double.NaN if not available.

getTotal

public double getTotal()
Get the cpu utilization

Returns:
The cpu utilization; or a Double.NaN if not available.

getLoad

public double[] getLoad()
Get the system load

Returns:
The system load average; or a Double.NaN if not available.

getAvailableProcessors

public int getAvailableProcessors()
Get the number of processors on the machine

Returns:
The number of available processors on the machine

toString

public String toString()
Overrides:
toString in class MeasuredResource

Copyright © Rio Project.

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