private Map<StatisticsType, Set<Statistics>> initAllStatistics() throws InterruptedException { assertTrue(this.statSampler.waitForInitialization(5000)); Map<StatisticsType, Set<Statistics>> statsTypeToStats = new HashMap<StatisticsType, Set<Statistics>>(); Statistics[] stats = this.statSampler.getStatistics(); for (int i = 0; i < stats.length; i++) { StatisticsType statsType = stats[i].getType(); Set<Statistics> statsSet = statsTypeToStats.get(statsType); if (statsSet == null) { statsSet = new HashSet<Statistics>(); statsSet.add(stats[i]); statsTypeToStats.put(statsType, statsSet); } else { statsSet.add(stats[i]); } } return statsTypeToStats; }
/** * Statistics[0]: typeName=StatSampler instanceName=statSampler * Statistics[1]: typeName=VMStats instanceName=vmStats * Statistics[2]: typeName=VMMemoryUsageStats instanceName=vmHeapMemoryStats * Statistics[3]: typeName=VMMemoryUsageStats instanceName=vmNonHeapMemoryStats * Statistics[4]: typeName=VMMemoryPoolStats instanceName=Code Cache-Non-heap memory * Statistics[5]: typeName=VMMemoryPoolStats instanceName=PS Eden Space-Heap memory * Statistics[6]: typeName=VMMemoryPoolStats instanceName=PS Survivor Space-Heap memory * Statistics[7]: typeName=VMMemoryPoolStats instanceName=PS Old Gen-Heap memory * Statistics[8]: typeName=VMMemoryPoolStats instanceName=PS Perm Gen-Non-heap memory * Statistics[9]: typeName=VMGCStats instanceName=PS Scavenge * Statistics[10]: typeName=VMGCStats instanceName=PS MarkSweep * Statistics[11]: typeName=LinuxSystemStats instanceName=kuwait.gemstone.com * Statistics[12]: typeName=LinuxProcessStats instanceName=javaApp0-proc */ protected void dumpStatistics() throws InterruptedException { Statistics[] stats = this.statSampler.getStatistics(); for (int i = 0; i < stats.length; i++) { System.out.println("Statistics["+i+"]: typeName=" + stats[i].getType().getName() + " instanceName=" + stats[i].getTextId()); } } }