CollTongweb5.java 21 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465
package com.sitech.ismp.coll.middleware.tongweb.impl;

import java.io.IOException;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;
import java.util.Vector;
import java.util.logging.Logger;

import javax.management.j2ee.statistics.CountStatistic;
import javax.management.j2ee.statistics.RangeStatistic;
import javax.management.remote.JMXConnector;



import com.sitech.ismp.coll.CollBase;
import com.sitech.ismp.coll.basic.TblATO_KPIDETAIL;
import com.sitech.util.Formater;
//import com.tongweb.api.management.DomainRoot;
//import com.tongweb.api.management.client.ProxyFactory;
//import com.tongweb.api.management.monitor.HTTPListenerMonitor;
//import com.tongweb.api.management.monitor.JDBCConnectionPoolMonitor;
//import com.tongweb.api.management.monitor.MonitoringRoot;
//import com.tongweb.api.management.monitor.ServerRootMonitor;
//import com.tongweb.api.management.monitor.statistics.AltJDBCConnectionPoolStats;
//import com.tongweb.api.management.monitor.statistics.HTTPListenerStats;
//import com.tongweb.api.management.monitor.statistics.WebModuleVirtualServerStats;

public class CollTongweb5 extends CollTongweb implements ICollTongweb {
	
	private Logger logger = Logger.getLogger("COLL");
	private static String KBP_CLASS = "10-12-14";

	public CollTongweb5() {
	}

	public Vector<TblATO_KPIDETAIL> getJVM(HashMap params) {
		CollBase collResult = new CollBase();
		init(params);
		String domain_name = params.get("DOMAIN_NAME").toString();
		String UNIT_ID = KBP_CLASS + "-10:" + Formater.neatenunitid(domain_name)+"-total";
		try {
			String on = "com.tongtech.tongweb:name=runtime,type=runtime,category=monitor,server=server";
			//JVM实现版本
			String vmversion_current = execute(on,"vmversion-current").toString();
			//JVM实现名称
			String vmname_current = execute(on,"vmname-current").toString();
			collResult.addKPI(UNIT_ID, "CM-00-04-006-01", vmname_current+" "+vmversion_current);
			
			//JVM规范名称
			String specname_current = execute(on,"specname-current").toString();
			collResult.addKPI(UNIT_ID, "CM-00-04-006-02", specname_current);

			//传递给JVM输入参数 
			//String inputarguments_current = execute(on,"inputarguments-current").toString();
			//collResult.addKPI(UNIT_ID, "CM-00-04-006-03", inputarguments_current);

			//引导类加载器类路径
			//String bootclasspath_current = execute(on,"bootclasspath-current").toString();
			//collResult.addKPI(UNIT_ID, "CM-00-04-006-04", bootclasspath_current);
			
			//厂商
			String specvendor_current = execute(on,"specvendor-current").toString();
			collResult.addKPI(UNIT_ID, "CM-00-04-006-05", specvendor_current);
			
			//JAVA类库路径
			String librarypath_current = execute(on,"librarypath-current").toString();
			collResult.addKPI(UNIT_ID, "CM-00-04-006-06", librarypath_current);

			//名称
			String name_current1 = execute(on,"name-current").toString();
			collResult.addKPI(UNIT_ID, "CM-00-04-006-07", name_current1);
			
			//运行时间 h
			String uptime_count = execute(on,"uptime-count").toString();
			double l_uptime_count = Double.parseDouble(uptime_count)/1000/60/60;
			collResult.addKPI(UNIT_ID, "PM-00-04-006-01", String.format("%.2f", l_uptime_count));
			
			on = "com.tongtech.tongweb:name=operating-system,type=operating-system,category=monitor,server=server";
			//可用于JVM处理器数量
			String availableprocessors_count = execute(on,"availableprocessors-count").toString();
			collResult.addKPI(UNIT_ID, "CM-00-04-006-08", availableprocessors_count);
			
			//操作系统体系结构
			String arch_current = execute(on,"arch-current").toString();
			collResult.addKPI(UNIT_ID, "CM-00-04-006-09", arch_current);

			//操作系统版本
			String name_current2 = execute(on,"name-current").toString();
			String version_current = execute(on,"version-current").toString();
			collResult.addKPI(UNIT_ID, "CM-00-04-006-10", name_current2 + " " + version_current);
			
			//编译所花费的累积时间 s
			on = "com.tongtech.tongweb:name=compilation-system,type=compilation-system,category=monitor,server=server";
			String totalcompilationtime_count = execute(on,"totalcompilationtime-count").toString();
			double l_totalcompilationtime_count = Double.parseDouble(totalcompilationtime_count)/1000;
			collResult.addKPI(UNIT_ID, "PM-00-04-006-02", l_totalcompilationtime_count+"");
			
			//JIT编译器
			String name_current = execute(on,"name-current").toString();
			collResult.addKPI(UNIT_ID, "CM-00-04-006-11", name_current);
			
			on = "com.tongtech.tongweb:name=Copy,type=garbage-collector,category=monitor,server=server";
			//垃圾回收次数
			String collectioncount_count = execute(on,"collectioncount-count").toString();
			collResult.addKPI(UNIT_ID, "PM-00-04-006-03", collectioncount_count+"");
			
			//累计垃圾回收时长ms
			String collectiontime_count = execute(on,"collectiontime-count").toString();
			collResult.addKPI(UNIT_ID, "PM-00-04-006-04", collectiontime_count+"");
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally {
			this.release();
		}
		return collResult.KPISet;
	}

	
	public Vector<TblATO_KPIDETAIL> getThread(HashMap params) {
		CollBase collResult = new CollBase();
		init(params);
		String domain_name = params.get("DOMAIN_NAME").toString();
		String UNIT_ID = KBP_CLASS + "-11:" + Formater.neatenunitid(domain_name)+"-thread";
		try {
			String on = "com.tongtech.tongweb:name=thread-system,type=thread-system,category=monitor,server=server";
			//守护程序线程数
			String daemonthreadcount_count = execute(on,"daemonthreadcount-count").toString();
			collResult.addKPI(UNIT_ID, "PM-00-04-007-01", daemonthreadcount_count+"");
			
			//活动线程
			String threadcount_count = execute(on,"threadcount-count").toString();
			collResult.addKPI(UNIT_ID, "PM-00-05-009-48", threadcount_count+"");
			
			//启动线程总数
			String totalstartedthreadcount_count = execute(on,"totalstartedthreadcount-count").toString();
			collResult.addKPI(UNIT_ID, "PM-00-04-007-02", totalstartedthreadcount_count+"");
			
			//启动最大线程个数
			String peakthreadcount_count = execute(on,"peakthreadcount-count").toString();
			collResult.addKPI(UNIT_ID, "PM-00-04-007-03", peakthreadcount_count+"");
			
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally {
			this.release();
		}
		return collResult.KPISet;
	}

	
	public Vector<TblATO_KPIDETAIL> getMemory(HashMap params) {
		CollBase collResult = new CollBase();
		init(params);
		String domain_name = params.get("DOMAIN_NAME").toString();
		String UNIT_ID = KBP_CLASS + "-12:" + Formater.neatenunitid(domain_name)+"-memory";
		try {
			
			String on = "com.tongtech.tongweb:type=jvm,category=monitor,server=server";
			//最大堆大小 kb
			String heapsize_upperbound = execute(on,"heapsize-upperbound").toString();
			double l_heapsize_upperbound = Double.parseDouble(heapsize_upperbound)/1024;
			collResult.addKPI(UNIT_ID, "PM-00-04-008-01", String.format("%.2f", l_heapsize_upperbound));

			//提交的内存 kb
			String heapsize_current = execute(on,"heapsize-current").toString();
			double l_heapsize_current = Double.parseDouble(heapsize_current)/1024;
			collResult.addKPI(UNIT_ID, "PM-00-04-008-02", String.format("%.2f", l_heapsize_current));
			
			on = "com.tongtech.tongweb:name=memory,type=memory,category=monitor,server=server";
			//当前堆大小 kb
			String usedheapsize_count = execute(on,"usedheapsize-count").toString();
			double l_usedheapsize_count = Double.parseDouble(usedheapsize_count)/1024;
			collResult.addKPI(UNIT_ID, "PM-00-04-008-03", String.format("%.2f", l_usedheapsize_count));

			//堆使用率%
			double syr = l_usedheapsize_count/l_heapsize_upperbound*100;
			collResult.addKPI(UNIT_ID, "PM-00-04-004-04", String.format("%.2f", syr));
			
			//Java虚拟机在启动期间从操作系统请求用于内存管理的非堆区域初始内存容量kb
			String initnonheapsize_count = execute(on,"initnonheapsize-count").toString();
			double l_initnonheapsize_count = Double.parseDouble(initnonheapsize_count)/1024;
			collResult.addKPI(UNIT_ID, "PM-00-04-008-04", String.format("%.2f", l_initnonheapsize_count));
			
			//可用于内存管理的最大非堆大小kb
			String maxnonheapsize_count = execute(on,"maxnonheapsize-count").toString();
			double l_maxnonheapsize_count = Double.parseDouble(maxnonheapsize_count)/1024;
			collResult.addKPI(UNIT_ID, "PM-00-04-008-05", String.format("%.2f", l_maxnonheapsize_count));
			
			//最初由JVM请求的堆大小kb
			String initheapsize_count = execute(on,"initheapsize-count").toString();
			double l_initheapsize_count = Double.parseDouble(initheapsize_count)/1024;
			collResult.addKPI(UNIT_ID, "PM-00-04-008-06", String.format("%.2f", l_initheapsize_count));

			//可用于内存管理的最大堆大小kb
			String maxheapsize_count = execute(on,"maxheapsize-count").toString();
			double l_maxheapsize_count = Double.parseDouble(maxheapsize_count)/1024;
			collResult.addKPI(UNIT_ID, "PM-00-04-008-07", String.format("%.2f", l_maxheapsize_count));
			
			//确认可由JVM使用的非堆内存容量kb
			String committednonheapsize_count = execute(on,"committednonheapsize-count").toString();
			double l_committednonheapsize_count = Double.parseDouble(committednonheapsize_count)/1024;
			collResult.addKPI(UNIT_ID, "PM-00-04-008-08", String.format("%.2f", l_committednonheapsize_count));
			
			//确认可由JVM使用的堆内存容量
			String committedheapsize_count = execute(on,"committedheapsize-count").toString();
			double l_committedheapsize_count = Double.parseDouble(committedheapsize_count)/1024;
			collResult.addKPI(UNIT_ID, "PM-00-04-008-09", String.format("%.2f", l_committedheapsize_count));
			
			//当前正在使用的非堆区域的大小
			String usednonheapsize_count = execute(on,"usednonheapsize-count").toString();
			double l_usednonheapsize_count = Double.parseDouble(usednonheapsize_count)/1024;
			collResult.addKPI(UNIT_ID, "PM-00-04-008-10", String.format("%.2f", l_usednonheapsize_count));
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally {
			this.release();
		}
		return collResult.KPISet;
	}
	
	
	
	
	public Vector<TblATO_KPIDETAIL> getApplication(HashMap params) {
		CollBase collResult = new CollBase();
//		init(params);
//		String domain_name = params.get("DOMAIN_NAME").toString();
//		String UNIT_ID = KBP_CLASS + "-13:" + Formater.neatenunitid(domain_name) + "-application";
//		try {
//			DomainRoot dr = ProxyFactory.getInstance(JMXConn.getMBeanServerConnection()).getDomainRoot();
//			WebModuleVirtualServerStats wmvs = dr.getMonitoringRoot()
//												.getServerRootMonitorMap()
//												.get("server")
//												.getWebModuleVirtualServerMonitorMap()
//												.get("//admin/twns")
//												.getWebModuleVirtualServerStats();
//			//当前活动会话数量
//			CountStatistic activeSessionsCurrent = wmvs.getActiveSessionsCurrent();
//			String _activeSessionsCurrent = activeSessionsCurrent.getCount()+"";
//			collResult.addKPI(UNIT_ID, "PM-00-04-012-01", _activeSessionsCurrent);
//
//			//并发活动会话最大数量
//			CountStatistic activeSessionsHigh = wmvs.getActiveSessionsHigh();
//			String _activeSessionsHigh = activeSessionsHigh.getCount()+"";
//			collResult.addKPI(UNIT_ID, "PM-00-04-012-02", _activeSessionsHigh);
//
//			//过期会话总数量
//			CountStatistic expiredSessionsTotal = wmvs.getExpiredSessionsTotal();
//			String _expiredSessionsTotal = expiredSessionsTotal.getCount()+"";
//			collResult.addKPI(UNIT_ID, "PM-00-04-012-03", _expiredSessionsTotal);
//
//			//拒绝会话总数
//			CountStatistic RejectedSessionsTotal = wmvs.getRejectedSessionsTotal();
//			String _RejectedSessionsTotal = RejectedSessionsTotal.getCount()+"";
//			collResult.addKPI(UNIT_ID, "PM-00-04-012-04", _RejectedSessionsTotal);
//
//			//创建会话总数
//			CountStatistic SessionsTotal = wmvs.getSessionsTotal();
//			String _SessionsTotal = SessionsTotal.getCount()+"";
//			collResult.addKPI(UNIT_ID, "PM-00-04-012-05", _SessionsTotal);
//
//			//已加载JSP页面数量
//			CountStatistic jspcount = wmvs.getJSPCount();
//			String _jspcount = jspcount.getCount()+"";
//			collResult.addKPI(UNIT_ID, "PM-00-04-012-06", _jspcount);
//
//			//调用JSP错误数量
//			CountStatistic jspErrorCount = wmvs.getJSPErrorCount();
//			String _jspErrorCount = jspErrorCount.getCount()+"";
//			collResult.addKPI(UNIT_ID, "PM-00-04-012-07", _jspErrorCount);
//
//			//被加载JSP页面数量
//			CountStatistic JSPReloadCount = wmvs.getJSPReloadCount();
//			String _JSPReloadCount = JSPReloadCount.getCount()+"";
//			collResult.addKPI(UNIT_ID, "PM-00-04-012-08", _JSPReloadCount);
//
//			//servlet处理总时长
//			CountStatistic ServletProcessingTimes = wmvs.getServletProcessingTimes();
//			String _ServletProcessingTimes = ServletProcessingTimes.getCount()+"";
//			collResult.addKPI(UNIT_ID, "PM-00-04-012-09", String.valueOf(_ServletProcessingTimes));
//
//			//
//			UNIT_ID = KBP_CLASS + "-15:" + Formater.neatenunitid(domain_name)+"-jdbc";
//			Map<String, JDBCConnectionPoolMonitor> jdbccpms = dr.getMonitoringRoot().getServerRootMonitorMap().get("server").getJDBCConnectionPoolMonitorMap();
//			for(Map.Entry<String, JDBCConnectionPoolMonitor> entry:jdbccpms.entrySet()){
//				System.out.println(entry.getKey()+"--->"+entry.getValue());
//				String jdbcKey = entry.getKey();
//				UNIT_ID = UNIT_ID+"-"+jdbcKey;
//				//JDBC名称
//				collResult.addKPI(UNIT_ID, "CM-00-04-011-01", jdbcKey);
//				AltJDBCConnectionPoolStats jdbccpm = jdbccpms.get(jdbcKey).getAltJDBCConnectionPoolStats();
//
//				//成功连接平均等待时间
//				CountStatistic AverageConnWaitTime = jdbccpm.getAverageConnWaitTime();
//				String _AverageConnWaitTime = AverageConnWaitTime.getCount()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-011-01", _AverageConnWaitTime);
//
//				//回收连接数
//				CountStatistic NumConnAcquired = jdbccpm.getNumConnAcquired();
//				String _NumConnAcquired = NumConnAcquired.getCount()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-011-02", _NumConnAcquired);
//
//				//创建连接数
//				CountStatistic NumConnCreated = jdbccpm.getNumConnCreated();
//				String _NumConnCreated = NumConnCreated.getCount()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-011-03", _NumConnCreated);
//
//				//摧毁连接数
//				CountStatistic NumConnDestroyed = jdbccpm.getNumConnDestroyed();
//				String _NumConnDestroyed = NumConnDestroyed.getCount()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-011-04", _NumConnDestroyed);
//
//				//验证失败连接数
//				CountStatistic NumConnFailedValidation = jdbccpm.getNumConnFailedValidation();
//				String _NumConnFailedValidation = NumConnFailedValidation.getCount()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-011-05", _NumConnFailedValidation);
//
//				//释放连接数
//				CountStatistic NumConnReleased = jdbccpm.getNumConnReleased();
//				String _NumConnReleased = NumConnReleased.getCount()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-011-06", _NumConnReleased);
//
//				//连接超时时长
//				CountStatistic NumConnTimedOut = jdbccpm.getNumConnTimedOut();
//				String _NumConnTimedOut = NumConnTimedOut.getCount()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-011-07", _NumConnTimedOut);
//
//				//等待连接数
//				CountStatistic NumPotentialConnLeak = jdbccpm.getNumPotentialConnLeak();
//				String _NumPotentialConnLeak = NumPotentialConnLeak.getCount()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-011-08", _NumPotentialConnLeak);
//
//				//等待连接数
//				CountStatistic WaitQueueLength = jdbccpm.getWaitQueueLength();
//				String _WaitQueueLength = WaitQueueLength.getCount()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-011-09", _WaitQueueLength);
//
//				//连接等待时长
//				RangeStatistic ConnRequestWaitTime = jdbccpm.getConnRequestWaitTime();
//				String _ConnRequestWaitTime = ConnRequestWaitTime.getCurrent()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-011-10", _ConnRequestWaitTime);
//
//				//连接池中的连接数量
//				RangeStatistic NumConnFree = jdbccpm.getNumConnFree();
//				String _NumConnFree = NumConnFree.getCurrent()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-011-12", _NumConnFree);
//
//				//连接池中的已使用连接数量
//				RangeStatistic NumConnUsed = jdbccpm.getNumConnUsed();
//				String _NumConnUsed = NumConnUsed.getCurrent()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-011-13", _NumConnUsed);
//			}
//
//
//			UNIT_ID = KBP_CLASS + "-14:" + Formater.neatenunitid(domain_name)+"-httpthread";
//
//			Map<String, HTTPListenerMonitor> HTTPListenerMonitors = dr.getMonitoringRoot()
//			                                                          .getServerRootMonitorMap()
//			                                                          .get("server")
//			                                                          .getWebContainerMonitor()
//			                                                          .getHTTPListenerMonitorMap();
//			for(Map.Entry<String, HTTPListenerMonitor> entry:HTTPListenerMonitors.entrySet()){
//				System.out.println(entry.getKey()+"--->"+entry.getValue());
//				String threadKey = entry.getKey();
//				UNIT_ID = UNIT_ID+"-"+threadKey;
//				//http通道名称
//				collResult.addKPI(UNIT_ID, "CM-00-04-010-01", threadKey);
//				HTTPListenerStats httpStats = HTTPListenerMonitors.get(threadKey).getHTTPListenerStats();
//
//				//处理器累积接收请求字节数
//				CountStatistic BytesReceived = httpStats.getBytesReceived();
//				String _BytesReceived = BytesReceived.getCount()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-010-01", _BytesReceived);
//
//				//处理器累积发送请求字节数
//				CountStatistic BytesSent = httpStats.getBytesSent();
//				String _BytesSent = BytesSent.getCount()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-010-02", _BytesSent);
//
//				//连接数
//				CountStatistic CountOpenConnections = httpStats.getCountOpenConnections();
//				String _CountOpenConnections = CountOpenConnections.getCount()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-010-03", _CountOpenConnections);
//
//				//其它连接数
//				CountStatistic CountOther = httpStats.getCountOther();
//				String _CountOther = CountOther.getCount()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-010-04", _CountOther);
//
//				//当前线程数
//				CountStatistic CurrentThreadCount = httpStats.getCurrentThreadCount();
//				String _CurrentThreadCount = CurrentThreadCount.getCount()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-010-05", _CurrentThreadCount);
//
//				//正在使用线程数
//				CountStatistic CurrentThreadsBusy = httpStats.getCurrentThreadsBusy();
//				String _CurrentThreadsBusy = CurrentThreadsBusy.getCount()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-010-06", _CurrentThreadsBusy);
//
//				//大于或等于错误代码400总数
//				CountStatistic ErrorCount = httpStats.getErrorCount();
//				String _ErrorCount = ErrorCount.getCount()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-010-07", _ErrorCount);
//
//				//最大使用线程数
//				CountStatistic MaxOpenConnections = httpStats.getMaxOpenConnections();
//				String _MaxOpenConnections = MaxOpenConnections.getCount()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-010-08", _MaxOpenConnections);
//
//				//最大线程数
//				CountStatistic MaxSpareThreads = httpStats.getMaxSpareThreads();
//				String _MaxSpareThreads = MaxSpareThreads.getCount()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-010-09", _MaxSpareThreads);
//
//				//线程池允许的最大线程数量
//				CountStatistic MaxThreads = httpStats.getMaxThreads();
//				String _MaxThreads = MaxThreads.getCount()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-010-10", _MaxThreads);
//
//				//最小线程数
//				CountStatistic MinSpareThreads = httpStats.getMinSpareThreads();
//				String _MinSpareThreads = MinSpareThreads.getCount()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-010-11", _MinSpareThreads);
//
//				//请求平均处理时长
//				CountStatistic ProcessingTime = httpStats.getProcessingTime();
//				String _ProcessingTime = ProcessingTime.getCount()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-010-12", _ProcessingTime);
//
//				//请求数量
//				CountStatistic RequestCount = httpStats.getRequestCount();
//				String _RequestCount = RequestCount.getCount()+"";
//				collResult.addKPI(UNIT_ID, "PM-00-04-010-13", _RequestCount);
//			}
//
//		} catch (IOException e) {
//			e.printStackTrace();
//		}catch (NullPointerException e1) {
//			e1.printStackTrace();
//		} finally {
//			this.release();
//		}
		return collResult.KPISet;
	}
	
	
	
	public static void main(String[] args) {
		HashMap params = new HashMap();
		params.put(JMXConnector.CREDENTIALS, new String[]{"admin","adminadmin"});
		params.put("JMX_URL", "service:jmx:rmi:///jndi/rmi://172.21.0.96:7200/jmxrmi");
		params.put("DOMAIN_NAME", "testtongweb5");
		params.put("USER", "admin");
		params.put("PASSWORD", "adminadmin");
		CollTongweb5 ct = new CollTongweb5();
		Vector<TblATO_KPIDETAIL> result = ct.getJVM(params);
		for (TblATO_KPIDETAIL tk : result) {
			System.out.println("[" + tk.UNIT_ID + "][" + tk.KPI_ID + "][" + tk.KPI_VALUE + "][" + tk.CLL_TIME + "]");
		}
	}
}