static void printPerfCounters(PerfCounterInfo[] pcis) { for(int i=0; pcis!=null && i<pcis.length; i++) { System.out.println("\nKey:" + pcis[i].getKey()); String perfCounter = pcis[i].getGroupInfo().getKey() + "" + pcis[i].getNameInfo().getKey() + "." + pcis[i].getRollupType(); System.out.println("PerfCounter:" + perfCounter); System.out.println("Level:" + pcis[i].getLevel()); System.out.println("StatsType:" + pcis[i].getStatsType()); System.out.println("UnitInfo:" + pcis[i].getUnitInfo().getKey()); } }
static void printPerfCounters(PerfCounterInfo[] pcis) { for(int i=0; pcis!=null && i<pcis.length; i++) { System.out.println("\nKey:" + pcis[i].getKey()); String perfCounter = pcis[i].getGroupInfo().getKey() + "." + pcis[i].getNameInfo().getKey() + "." + pcis[i].getRollupType(); System.out.println("PerfCounter:" + perfCounter); System.out.println("Level:" + pcis[i].getLevel()); System.out.println("StatsType:" + pcis[i].getStatsType()); System.out.println("UnitInfo:" + pcis[i].getUnitInfo().getKey()); } }
private List getCounterByName(String name) throws IOException { List<String> ctrProps = counterCache.getIfPresent(name); if (ctrProps != null) { LOG.debug("CacheHIT: PerfCounter name: " + name); return ctrProps; } PerfCounterInfo[] pcis = performanceManager.getPerfCounter(); String perfCounter = ""; for (int i = 0; i < pcis.length; i++) { perfCounter = pcis[i].getGroupInfo().getKey() + "." + pcis[i].getNameInfo().getKey() + "." + pcis[i].getRollupType().toString(); ctrProps = new ArrayList<String>(); ctrProps.add(String.valueOf(pcis[i].getKey())); ctrProps.add(pcis[i].getUnitInfo().getKey().toString()); ctrProps.add(pcis[i].getStatsType().toString()); ctrProps.add(pcis[i].getRollupType().toString()); counterCache.put(perfCounter, ctrProps); if (perfCounter.equals(name)) { LOG.debug("CacheMISS: PerfCounter name: " + name); return ctrProps; } } return counterCache.getIfPresent(name); }
String perfCounterString = perfCounterInfo.getKey() + " : " + perfCounterInfo.getGroupInfo().getKey() + "." + perfCounterInfo.getNameInfo().getKey() + "." + perfCounterInfo.getRollupType().toString() + " : " + perfCounterInfo.getNameInfo().getLabel() + " in " + perfCounterInfo.getUnitInfo().getLabel() + " (" + perfCounterInfo.getStatsType().toString() + ")"; out.print(perfCounterString + "\n");
String perfCounterString = perfCounterInfo.getKey() + " : " + perfCounterInfo.getGroupInfo().getKey() + "." + perfCounterInfo.getNameInfo().getKey() + "." + perfCounterInfo.getRollupType().toString() + " : " + perfCounterInfo.getNameInfo().getLabel() + " in " + perfCounterInfo.getUnitInfo().getLabel() + " (" + perfCounterInfo.getStatsType().toString() + ")"; out.print(perfCounterString + "\n");