Rio Project 4.2 API Documentation



org.rioproject.system.measurable.cpu
Class ProcessCPUHandler

java.lang.Object
  extended by org.rioproject.system.measurable.cpu.ProcessCPUHandler
All Implemented Interfaces:
MeasurableMonitor, MXBeanMonitor<OperatingSystemMXBean>

public class ProcessCPUHandler
extends Object
implements MXBeanMonitor<OperatingSystemMXBean>

CPU monitor that obtains process CPU utilization. This utility uses either Hyperic SIGAR, or OperatingSystemMXBean to obtain process CPU time. Hyperic SIGAR is preferred. If not available the com.sun.management.OperatingSystemMXBean will be used.

Note: Hyperic SIGAR is licensed under the GPL with a FLOSS license exception, allowing it to be included with the Rio Apache License v2 distribution. If for some reason the GPL cannot be used with your distribution of Rio, remove the RIO_HOME/lib/hyperic directory.

Author:
Dennis Reedy

Constructor Summary
ProcessCPUHandler()
           
ProcessCPUHandler(long pid)
           
 
Method Summary
 MeasuredResource getMeasuredResource()
          Get the MeasuredResource
 void setID(String id)
          Set the identifier for the resource being measured
 void setMXBean(OperatingSystemMXBean mxBean)
          Set the platform MBean to monitor
 void setPID(long pid)
           
 void setStartTime(long startTime)
           
 void setThresholdValues(ThresholdValues tVals)
          Set the ThresholdValues for the resource being measured
 void terminate()
          Terminate any collection mechanisms
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessCPUHandler

public ProcessCPUHandler()

ProcessCPUHandler

public ProcessCPUHandler(long pid)
Method Detail

setMXBean

public void setMXBean(OperatingSystemMXBean mxBean)
Description copied from interface: MXBeanMonitor
Set the platform MBean to monitor

Specified by:
setMXBean in interface MXBeanMonitor<OperatingSystemMXBean>
Parameters:
mxBean - The platform MBean

setPID

public void setPID(long pid)

setStartTime

public void setStartTime(long startTime)

setID

public void setID(String id)
Description copied from interface: MeasurableMonitor
Set the identifier for the resource being measured

Specified by:
setID in interface MeasurableMonitor
Parameters:
id - The identifier

setThresholdValues

public void setThresholdValues(ThresholdValues tVals)
Description copied from interface: MeasurableMonitor
Set the ThresholdValues for the resource being measured

Specified by:
setThresholdValues in interface MeasurableMonitor
Parameters:
tVals - The ThresholdValues

getMeasuredResource

public MeasuredResource getMeasuredResource()
Description copied from interface: MeasurableMonitor
Get the MeasuredResource

Specified by:
getMeasuredResource in interface MeasurableMonitor
Returns:
The MeasuredResource for the MeasurableMonitor

terminate

public void terminate()
Description copied from interface: MeasurableMonitor
Terminate any collection mechanisms

Specified by:
terminate in interface MeasurableMonitor

Copyright © Rio Project.

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