sk.baka.webvm.analyzer
Interface ICpuUsageMeasure


public interface ICpuUsageMeasure

Interface for measuring CPU usage.

Author:
mvy

Method Summary
 int getAvgCpuUsage(Object m1, Object m2)
          Computes an average CPU usage between two measurements.
 Object measure()
          Measures an implementation-dependent CPU usage statistics.
 boolean supported()
          Checks if this particular implementation is supported on given host OS.
 

Method Detail

supported

boolean supported()
Checks if this particular implementation is supported on given host OS.

Returns:
true if it is supported, false otherwise.

measure

Object measure()
               throws Exception
Measures an implementation-dependent CPU usage statistics. Used in getAvgCpuUsage(java.lang.Object, java.lang.Object) to compute the real CPU usage.

Returns:
the measurement object
Throws:
Exception - if something happens.

getAvgCpuUsage

int getAvgCpuUsage(Object m1,
                   Object m2)
Computes an average CPU usage between two measurements. The first measurement was taken before the second one was taken.

The method must not fail if m1 is same as m2 - in such case return 0.

Parameters:
m1 - first measurement.
m2 - second measurement
Returns:
CPU usage in percent, must be a value between 0 and 100.


Copyright © 2010 Baka. All Rights Reserved.