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 String getAliasName(PerfCounterInfo perfCounterInfo) { String group = perfCounterInfo.getGroupInfo().getKey(); String name = perfCounterInfo.getNameInfo().getKey(); String rollup = perfCounterInfo.getRollupType().toString(); group = normalizeGroupName(group); String[] rollupChunks = {"summation", "average", "latest", "none", "minimum", "maximum", "total"}; String[] rollupReplacements = {"Sum", "Avg", "Lat", "Non", "Min", "Max", "Tot"}; for (int i = 0; i < rollupChunks.length; i++) { rollup = rollup.replace(rollupChunks[i], rollupReplacements[i]); } String[] nameChunks = {"unkown", "protos", "threshold", "datastore", "alloc", "utilization", "normalized", "normal", "shares", "depth", "resource", "overhead", "swap", "rate", "metric", "number", "averaged", "load", "decompression", "compression", "device", "latency", "capacity", "commands", "target", "aborted", "kernel", "unreserved", "reserved", "total", "read", "write", "queue", "limited", "sample", "count", "touched", "percentage", "seeks", "consumed", "medium", "small", "large", "active", "observed", "time"}; for (String chunk : nameChunks) { name = condenseName(name, chunk); } name = normalizeName(name); String full = group + name + rollup; if (full.length() >= 19) { System.out.println("******************************************"); System.out.println("Key '" + full + "' is " + full.length() + " characters long"); System.out.println("******************************************"); } return full; }
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); }
private String getAliasName(PerfCounterInfo perfCounterInfo) { String group = perfCounterInfo.getGroupInfo().getKey(); String name = perfCounterInfo.getNameInfo().getKey(); String rollup = perfCounterInfo.getRollupType().toString(); group = normalizeGroupName(group); String[] rollupChunks = {"summation", "average", "latest", "none", "minimum", "maximum", "total"}; String[] rollupReplacements = {"Sum", "Avg", "Lat", "Non", "Min", "Max", "Tot"}; for (int i = 0; i < rollupChunks.length; i++) { rollup = rollup.replace(rollupChunks[i], rollupReplacements[i]); } String[] nameChunks = {"unkown", "protos", "threshold", "datastore", "alloc", "utilization", "normalized", "normal", "shares", "depth", "resource", "overhead", "swap", "rate", "metric", "number", "averaged", "load", "decompression", "compression", "device", "latency", "capacity", "commands", "target", "aborted", "kernel", "unreserved", "reserved", "total", "read", "write", "queue", "limited", "sample", "count", "touched", "percentage", "seeks", "consumed", "medium", "small", "large", "active", "observed", "time"}; for (String chunk : nameChunks) { name = condenseName(name, chunk); } name = normalizeName(name); String full = group + name + rollup; if (full.length() >= 19) { System.out.println("******************************************"); System.out.println("Key '" + full + "' is " + full.length() + " characters long"); System.out.println("******************************************"); } return full; }
/** * Generates a human-readable name for a performance counter. * * @param perfCounterInfo the perfomance counter info object * @return a string-representation of the performance counter's name */ private String getHumanReadableName(PerfCounterInfo perfCounterInfo) { return perfCounterInfo.getGroupInfo().getKey() + "." + perfCounterInfo.getNameInfo().getKey() + "." + perfCounterInfo.getRollupType().toString(); }
/** * Generates a human-readable name for a performance counter. * * @param perfCounterInfo the perfomance counter info object * @return a string-representation of the performance counter's name */ private String getHumanReadableName(PerfCounterInfo perfCounterInfo) { return perfCounterInfo.getGroupInfo().getKey() + "." + perfCounterInfo.getNameInfo().getKey() + "." + perfCounterInfo.getRollupType().toString(); }
private String getHumanReadableName(PerfCounterInfo perfCounterInfo) { return perfCounterInfo.getGroupInfo().getKey() + "." + perfCounterInfo.getNameInfo().getKey() + "." + perfCounterInfo.getRollupType().toString(); }
private String getHumanReadableName(PerfCounterInfo perfCounterInfo) { return perfCounterInfo.getGroupInfo().getKey() + "." + perfCounterInfo.getNameInfo().getKey() + "." + perfCounterInfo.getRollupType().toString(); }
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");
String groupName = perfCounterInfo.getGroupInfo().getKey(); String normalizedGroupName = normalizeGroupName(groupName);
String groupName = perfCounterInfo.getGroupInfo().getKey(); String normalizedGroupName = normalizeGroupName(groupName);