Methods Summary |
---|
public CountStatistic | getAvailableProcessors()
int availProcs = Runtime.getRuntime().availableProcessors();
return StatisticFactory.getCountStatistic(availProcs, "AvailableProcessors",
"Numbers", "Processors Available to the JVM",
System.currentTimeMillis(), initTime);
|
public javax.management.j2ee.statistics.BoundedRangeStatistic | getHeapSize()
long heapSize = Runtime.getRuntime().totalMemory();
long upper = Runtime.getRuntime().maxMemory();
return StatisticFactory.getBoundedRangeStatistic(heapSize, heapSize, heapSize,
upper, 0, "HeapSize", "bytes",
"JVM Heap Size", initTime,
System.currentTimeMillis());
|
public CountStatistic | getMaxMemory()
long maxMem = Runtime.getRuntime().maxMemory();
return StatisticFactory.getCountStatistic(maxMem, "MaxMemory",
"bytes", "Memory Available to the JVM",
System.currentTimeMillis(), initTime);
|
public javax.management.j2ee.statistics.Statistic | getStatistic(java.lang.String statisticName)
if(statisticName != null){
try{
return (Statistic)(this.getClass().getMethod("get"+statisticName, null)).invoke(this,null);
}
catch(Exception e){
e.printStackTrace();
}
}
throw new NullPointerException("Cannot find Statistic as Statistic Name is not provided");
|
public java.lang.String[] | getStatisticNames()
return new String[]{"HeapSize","MaxMemory","UpTime", "AvailableProcessors"};
|
public javax.management.j2ee.statistics.Statistic[] | getStatistics()
Statistic[] stats = new Statistic[]{};
for(int i=0;i<getStatisticNames().length;i++){
stats[i]=getStatistic(getStatisticNames()[i]);
}
return stats;
|
public CountStatistic | getUpTime()
long curTime = System.currentTimeMillis();
long upTime = curTime - initTime;
return StatisticFactory.getCountStatistic(upTime, "UpTime", "milliseconds",
"Amount of time the JVM has been running",
curTime, initTime);
|