Class SystemMonitor
java.lang.Object
org.jpos.util.SystemMonitor
Periodically dumps Thread and memory usage
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionnoargs constructorSystemMonitor(int sleepTime, Logger logger, String realm) Constructs a monitor with the given polling interval and logger binding. -
Method Summary
Modifier and TypeMethodDescriptionvoiddump(PrintStream p, String indent) Dumps a human-readable representation of this object to the print stream.Returns the Logger associated with this source.getRealm()Returns the log realm associated with this source.voidrun()voidAttaches aLoggerand realm to this log source.voidsetSleepTime(int sleepTime) Sets the polling interval and (re)starts the monitor thread.voidshowThreadGroup(ThreadGroup g, PrintStream p, String indent) Recursively dumpsgand every parent thread group, with their threads.voidshutdown()Signals the monitor's run loop to terminate.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Loggeable
dumpModifier and TypeMethodDescriptiondefault voiddump(PrintStream p, String indent, LogRenderer.Type type) Dumps a representation of this object using the specified renderer type.
-
Constructor Details
-
SystemMonitor
public SystemMonitor()noargs constructor -
SystemMonitor
Constructs a monitor with the given polling interval and logger binding.- Parameters:
sleepTime- sleeplogger- current loggerrealm- instance realm
-
-
Method Details
-
setSleepTime
Sets the polling interval and (re)starts the monitor thread.- Parameters:
sleepTime- new sleepTime;
-
showThreadGroup
Recursively dumpsgand every parent thread group, with their threads.- Parameters:
g- starting thread groupp- destination streamindent- prefix used for indentation
-
run
-
shutdown
Signals the monitor's run loop to terminate. -
dump
-
setLogger
-
getRealm
-
getLogger
-