mstatusmonitor.java

来自「httptunnel.jar httptunnel java 源码」· Java 代码 · 共 40 行

JAVA
40
字号
package net.jumperz.app.MGuardian.plugin;

import java.io.*;
import java.util.*;
import net.jumperz.net.*;
import net.jumperz.util.*;
import net.jumperz.app.MGuardian.*;

public class MStatusMonitor
extends MGuardianPlugin
{
//--------------------------------------------------------------------------------
public Map execute( Map sessionInfo )
throws IOException
{
MHttpResponse response = new MHttpResponse();

StringBuffer strBuf = new StringBuffer( 1024 );

strBuf.append( "<html>" );
strBuf.append( "runningThreadCount: " );
strBuf.append( MGuardianImpl.getInstance().getThreadPool().getRunningThreadCount() );
strBuf.append( "<br>waitingThreadCount: " );
strBuf.append( MGuardianImpl.getInstance().getThreadPool().getWaitingThreadCount() );
strBuf.append( "<br>totalMemory: " );
strBuf.append( Runtime.getRuntime().totalMemory() );
strBuf.append( "<br>freeMemory: " );
strBuf.append( Runtime.getRuntime().freeMemory() );
strBuf.append( "<br>commandCount: " );
strBuf.append( MGuardianImpl.getInstance().getThreadPool().getCommandCount() );
strBuf.append( "</html>" );

response.setBody( strBuf.toString() );

Map pluginResult = new HashMap();
pluginResult.put( "response", response );
return pluginResult;
}
//--------------------------------------------------------------------------------
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?