TestRunner.java
1.35 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
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:iiop:///jndi/iiop://u01892.ef.kap.rsv.se:17020/weblogic.management.mbeanservers.runtime");
mon1.open();
jmxList.add(mon1);
Long time = System.currentTimeMillis() - ts1;
System.out.println(
"Open called on " + mon1.getConString()
+ "\nTime: " + time + "ms\n"
);
int times = 3;
while(times-- > 0) {
for(JmxMon mon : jmxList) {
ts1 = System.currentTimeMillis();
long age = mon1.getAgeTs();
mon.getData();
time = System.currentTimeMillis() - ts1;
System.out.println(
"GetData called on " + mon.domain + " (age was " + age + "s)"
+ "\nTime: " + time + "ms\n\n"
);
}
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.");
}
}
}