com.zwares.base.monitor
Class PerformanceMonitor

java.lang.Object
  |
  +--java.util.TimerTask
        |
        +--com.zwares.base.monitor.PerformanceMonitor
All Implemented Interfaces:
java.lang.Runnable

public class PerformanceMonitor
extends java.util.TimerTask

This class is responsible for monitoring performance information.


Constructor Summary
PerformanceMonitor()
          Default constructor, prints output to the diplay.
PerformanceMonitor(long timeInterval)
          Constructs performance monitoring Object.
PerformanceMonitor(long timeInterval, java.lang.String outputFileName)
          Constructs a performance monitoring object.
PerformanceMonitor(java.lang.String outputFileName)
          Constructs a performance monitoring object.
 
Method Summary
 void finalize()
          Cleanup resources
 void run()
          Collect and store memory and Thread statstics.
 void stopMonitoring()
          Stop performance monitoring.
 java.lang.String toString()
          Returns the monitor statics as String.
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PerformanceMonitor

public PerformanceMonitor()
Default constructor, prints output to the diplay.


PerformanceMonitor

public PerformanceMonitor(long timeInterval)
Constructs performance monitoring Object. Prints output to the diplay.

Parameters:
timeInterval - time interval in seconds.

PerformanceMonitor

public PerformanceMonitor(java.lang.String outputFileName)
Constructs a performance monitoring object. Prints output to the file.

Parameters:
outputFileName - file name to write to.

PerformanceMonitor

public PerformanceMonitor(long timeInterval,
                          java.lang.String outputFileName)
Constructs a performance monitoring object. Prints output to the file.

Parameters:
outputFileName - file name to write to.
timeInterval - time interval in seconds.
Method Detail

run

public void run()
Collect and store memory and Thread statstics.

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class java.util.TimerTask

stopMonitoring

public void stopMonitoring()
Stop performance monitoring.


finalize

public void finalize()
Cleanup resources

Overrides:
finalize in class java.lang.Object

toString

public java.lang.String toString()
Returns the monitor statics as String.

Overrides:
toString in class java.lang.Object