Rio Project 4.2 API Documentation



org.rioproject.system.measurable.cpu
Class CalculableCPU

java.lang.Object
  extended by org.rioproject.watch.Calculable
      extended by org.rioproject.system.measurable.cpu.CalculableCPU
All Implemented Interfaces:
Serializable

public class CalculableCPU
extends Calculable

A Calculable used to collect CPU system utilization

Author:
Dennis Reedy
See Also:
Serialized Form

Constructor Summary
CalculableCPU(String id, CpuUtilization cpuUtilization, long when)
          Creates new CalculableCPU
CalculableCPU(String id, double value, long when)
          Creates new CalculableCPU
 
Method Summary
 String getArchiveRecord()
          Gets an archival representation for this Calculable
 CpuUtilization getCpuUtilization()
          Get the CpuUtilization
 double getSystem()
          Get the cpu kernel usage
 double getTotal()
          Get the cpu utilization
 double getUser()
          Get the cpu user usage
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class org.rioproject.watch.Calculable
equals, getDate, getDetail, getId, getValue, getWhen, hashCode, setDetail, setId, setValue, setWhen
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CalculableCPU

public CalculableCPU(String id,
                     double value,
                     long when)
Creates new CalculableCPU

Parameters:
id - the identifier for this Calculable record
value - utilizatiion to record
when - the time when the recorded value was captured

CalculableCPU

public CalculableCPU(String id,
                     CpuUtilization cpuUtilization,
                     long when)
Creates new CalculableCPU

Parameters:
id - the identifier for this Calculable record
cpuUtilization - holds CPU utilization
when - the time when the recorded value was captured
Method Detail

getSystem

public double getSystem()
Get the cpu kernel usage

Returns:
The cpu kernel use as a percentage

getUser

public double getUser()
Get the cpu user usage

Returns:
The cpu user use as a percentage

getTotal

public double getTotal()
Get the cpu utilization

Returns:
The cpu utilization

getCpuUtilization

public CpuUtilization getCpuUtilization()
Get the CpuUtilization

Returns:
The CpuUtilization.

toString

public String toString()
Description copied from class: Calculable
Returns a string representation of the object.

Overrides:
toString in class Calculable
Returns:
String representation of the object.

getArchiveRecord

public String getArchiveRecord()
Gets an archival representation for this Calculable

Overrides:
getArchiveRecord in class Calculable
Returns:
a string representation in archive format

Copyright © Rio Project.

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