TestRunner.java 1.58 KB
package se.lil.jm;

import java.util.ArrayList;

public class TestRunner {

	public TestRunner() {
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) throws Throwable{
		// TODO Auto-generated method stub
		
		//ArrayList<OraMon> oraList = new ArrayList<OraMon>();
		ArrayList<JmxMon> jmxList = Registry.getList();
		
		Long ts1 = System.currentTimeMillis();
		
		JmxMon mon1 = new JmxMon("service:jmx:rmi:///jndi/iiop://u30128:23032/weblogic.management.mbeanservers.runtime"); // 10.3.6.0.161018.2
		//JmxMon mon1 = new JmxMon("service:jmx:rmi:///jndi/iiop://u30009:26732/weblogic.management.mbeanservers.runtime"); // 10.3.6.0.12.1
		mon1.open();
		jmxList.add(mon1);
				
		Long time = System.currentTimeMillis() - ts1;
		
		System.out.println(
				"Open called on " + mon1.getConString()
				+ "\nTime: " + time + "ms\n"
				);
		
		System.out.println("Connected to server " + mon1.getServerName() + " on domain " + mon1.getDomainName() + " and machine " + mon1.getRuntimeName());
		
		//mon1.listAllMBeans();
		//mon1.dumpAllMBeans("java.lang:*");
		/*
		int times = 0;
		while(times-- > 0) {
			for(JmxMon mon : jmxList) {
				ts1 = System.currentTimeMillis();
				long age = mon1.getAgeTs();
				mon.getData();
				time = System.currentTimeMillis() - ts1;
				
			}
			Thread.sleep(15000);
		}
		
		// Close all mon objects
		for(JmxMon mon : jmxList) {
			mon.close();
			System.out.println("Monitor closed. " + mon.getDataCalled() + " calls and " + mon.getDataSucceeded() + " succeeded and " + mon.getDataFailed() + " failed.");
		}
		*/
	}
}