Rio Project 4.2 API Documentation



org.rioproject.system.measurable.cpu
Class CalculableProcessCPU

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

public class CalculableProcessCPU
extends Calculable

A Calculable used to collect CPU system utilization

Author:
Dennis Reedy
See Also:
Serialized Form

Constructor Summary
CalculableProcessCPU(String id, double value, long when)
          Creates new CalculableCPU
CalculableProcessCPU(String id, ProcessCpuUtilization cpuUtilization, long when)
          Creates new CalculableCPU
 
Method Summary
 String getArchiveRecord()
          Gets an archival representation for this Calculable
 ProcessCpuUtilization getProcessCpuUtilization()
          Get the ProcessCpuUtilization
 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

CalculableProcessCPU

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

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

CalculableProcessCPU

public CalculableProcessCPU(String id,
                            ProcessCpuUtilization 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

getProcessCpuUtilization

public ProcessCpuUtilization getProcessCpuUtilization()
Get the ProcessCpuUtilization

Returns:
The ProcessCpuUtilization.

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.