org.eclipse.jetty.monitor
类 ThreadMonitor

java.lang.Object
  继承者 org.eclipse.jetty.util.component.AbstractLifeCycle
      继承者 org.eclipse.jetty.monitor.ThreadMonitor
所有已实现的接口:
Runnable, LifeCycle

public class ThreadMonitor
extends AbstractLifeCycle
implements Runnable


嵌套类摘要
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的嵌套类/接口
AbstractLifeCycle.AbstractLifeCycleListener
 
从接口 org.eclipse.jetty.util.component.LifeCycle 继承的嵌套类/接口
LifeCycle.Listener
 
字段摘要
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的字段
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
 
构造方法摘要
ThreadMonitor()
          Instantiates a new thread monitor.
ThreadMonitor(int intervalMs)
          Instantiates a new thread monitor.
ThreadMonitor(int intervalMs, int threshold)
          Instantiates a new thread monitor.
ThreadMonitor(int intervalMs, int threshold, int depth)
          Instantiates a new thread monitor.
ThreadMonitor(int intervalMs, int threshold, int depth, int trail)
          Instantiates a new thread monitor.
 
方法摘要
 void doStart()
           
 void doStop()
           
protected  long[] getAllThreadIds()
          Retrieve all avaliable thread ids
 int getBusyThreshold()
          Gets the busy threshold.
 Dumpable getDumpable()
           
 int getLogInterval()
          Gets the log interval.
 int getLogThreshold()
          Gets the log threshold.
 int getScanInterval()
          Gets the scan interval.
 int getStackDepth()
          Gets the stack depth.
protected  long getThreadCpuTime(long id)
          Retrieve the cpu time for specified thread.
 int getTrailLength()
          Gets the stack trace trail length.
protected  void init()
          Initialize JMX objects.
 void logCpuUsage(int frequencyMs, int thresholdPercent)
          Enable logging of CPU usage.
protected  void logThreadInfo(boolean logAll)
           
 void run()
           
 void setBusyThreshold(int percent)
          Sets the busy threshold.
 void setDumpable(Dumpable dumpable)
           
 void setLogInterval(int ms)
          Sets the log interval.
 void setLogThreshold(int percent)
          Sets the log threshold.
 void setScanInterval(int ms)
          Sets the scan interval.
 void setStackDepth(int stackDepth)
          Sets the stack depth.
 void setTrailLength(int trailLength)
          Sets the stack trace trail length.
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的方法
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

ThreadMonitor

public ThreadMonitor()
              throws Exception
Instantiates a new thread monitor.

抛出:
Exception

ThreadMonitor

public ThreadMonitor(int intervalMs)
              throws Exception
Instantiates a new thread monitor.

参数:
intervalMs - scan interval
抛出:
Exception

ThreadMonitor

public ThreadMonitor(int intervalMs,
                     int threshold)
              throws Exception
Instantiates a new thread monitor.

参数:
intervalMs - scan interval
threshold - busy threshold
抛出:
Exception

ThreadMonitor

public ThreadMonitor(int intervalMs,
                     int threshold,
                     int depth)
              throws Exception
Instantiates a new thread monitor.

参数:
intervalMs - scan interval
threshold - busy threshold
depth - stack compare depth
抛出:
Exception

ThreadMonitor

public ThreadMonitor(int intervalMs,
                     int threshold,
                     int depth,
                     int trail)
              throws Exception
Instantiates a new thread monitor.

参数:
intervalMs - scan interval
threshold - busy threshold
depth - stack compare depth
trail - length of stack trail
抛出:
Exception
方法详细信息

getScanInterval

public int getScanInterval()
Gets the scan interval.

返回:
the scan interval

setScanInterval

public void setScanInterval(int ms)
Sets the scan interval.

参数:
ms - the new scan interval

getLogInterval

public int getLogInterval()
Gets the log interval.

返回:
the log interval

setLogInterval

public void setLogInterval(int ms)
Sets the log interval.

参数:
ms - the new log interval

getBusyThreshold

public int getBusyThreshold()
Gets the busy threshold.

返回:
the busy threshold

setBusyThreshold

public void setBusyThreshold(int percent)
Sets the busy threshold.

参数:
percent - the new busy threshold

getLogThreshold

public int getLogThreshold()
Gets the log threshold.

返回:
the log threshold

setLogThreshold

public void setLogThreshold(int percent)
Sets the log threshold.

参数:
percent - the new log threshold

getStackDepth

public int getStackDepth()
Gets the stack depth.

返回:
the stack depth

setStackDepth

public void setStackDepth(int stackDepth)
Sets the stack depth.

参数:
stackDepth - the new stack depth

setTrailLength

public void setTrailLength(int trailLength)
Sets the stack trace trail length.

参数:
trailLength - the new trail length

getTrailLength

public int getTrailLength()
Gets the stack trace trail length.

返回:
the trail length

logCpuUsage

public void logCpuUsage(int frequencyMs,
                        int thresholdPercent)
Enable logging of CPU usage.

参数:
frequencyMs - the logging frequency
thresholdPercent - the logging threshold

getDumpable

public Dumpable getDumpable()
返回:
A Dumpable that is dumped whenever spinning threads are detected

setDumpable

public void setDumpable(Dumpable dumpable)
参数:
dumpable - A Dumpable that is dumped whenever spinning threads are detected

doStart

public void doStart()
覆盖:
AbstractLifeCycle 中的 doStart
另请参见:
AbstractLifeCycle.doStart()

doStop

public void doStop()
覆盖:
AbstractLifeCycle 中的 doStop
另请参见:
AbstractLifeCycle.doStop()

getAllThreadIds

protected long[] getAllThreadIds()
Retrieve all avaliable thread ids

返回:
array of thread ids

getThreadCpuTime

protected long getThreadCpuTime(long id)
Retrieve the cpu time for specified thread.

参数:
id - thread id
返回:
cpu time of the thread

init

protected void init()
Initialize JMX objects.


run

public void run()
指定者:
接口 Runnable 中的 run
另请参见:
Runnable.run()

logThreadInfo

protected void logThreadInfo(boolean logAll)


Copyright © 2013. All Rights Reserved.