protected void dump(PrintWriter stream) { calcStats(); stream.print(" " + descriptor.getName() + "="); stream.print("[size=" + getSnapshotsSize() + " min=" + nf.format(min) + " max=" + nf.format(max) + " avg=" + nf.format(avg) + " stddev=" + nf.format(stddev) + "]"); if (Boolean.getBoolean("StatArchiveReader.dumpall")) { series.dump(stream); } else { stream.println(); } }
protected void dump(PrintWriter stream) { calcStats(); stream.print(" " + descriptor.getName() + "="); stream.print("[size=" + getSnapshotsSize() + " min=" + nf.format(min) + " max=" + nf.format(max) + " avg=" + nf.format(avg) + " stddev=" + nf.format(stddev) + "]"); if (Boolean.getBoolean("StatArchiveReader.dumpall")) { series.dump(stream); } else { stream.println(); } }
calcStats(); StringBuffer result = new StringBuffer(); result.append(getDescriptor().getName()); String units = getDescriptor().getUnits(); if (units != null && units.length() > 0) {
String statName = ri.getType().getStats()[i].getName(); assertNotNull(statName);
assertEquals(1, statValues.length); final String statName = ri.getType().getStats()[0].getName(); assertNotNull(statName); assertEquals("long_counter_1", statName); assertEquals(statName, statValues[0].getDescriptor().getName()); assertEquals(1, statValues[0].getSnapshotsSize()); assertEquals((double)value, statValues[0].getSnapshotsMostRecent());
assertEquals(1, statValues.length); final String statName = ri.getType().getStats()[0].getName(); assertNotNull(statName); assertEquals("long_double_1", statName); assertEquals(statName, statValues[0].getDescriptor().getName()); assertEquals(1, statValues[0].getSnapshotsSize()); assertEquals(value, statValues[0].getSnapshotsMostRecent());
String statName = ri.getType().getStats()[i].getName(); assertNotNull(statName);
this.filter = this.values[0].getFilter(); String typeName = this.values[0].getType().getName(); String statName = this.values[0].getDescriptor().getName(); int bestTypeIdx = 0; for (int i=1; i < this.values.length; i++) { throw new IllegalArgumentException(LocalizedStrings.StatArchiveReader_CANT_COMBINE_VALUES_WITH_DIFFERENT_TYPES.toLocalizedString()); if (!statName.equals(this.values[i].getDescriptor().getName())) { throw new IllegalArgumentException(LocalizedStrings.StatArchiveReader_CANT_COMBINE_DIFFERENT_STATS.toLocalizedString());
calcStats(); StringBuffer result = new StringBuffer(); result.append(getDescriptor().getName()); String units = getDescriptor().getUnits(); if (units != null && units.length() > 0) {
this.filter = this.values[0].getFilter(); String typeName = this.values[0].getType().getName(); String statName = this.values[0].getDescriptor().getName(); int bestTypeIdx = 0; for (int i=1; i < this.values.length; i++) { throw new IllegalArgumentException(LocalizedStrings.StatArchiveReader_CANT_COMBINE_VALUES_WITH_DIFFERENT_TYPES.toLocalizedString()); if (!statName.equals(this.values[i].getDescriptor().getName())) { throw new IllegalArgumentException(LocalizedStrings.StatArchiveReader_CANT_COMBINE_DIFFERENT_STATS.toLocalizedString());
while (it.hasNext()) { ComboValue v = (ComboValue)it.next(); if (!spec.statMatches(v.getDescriptor().getName())) { continue;
while (it.hasNext()) { ComboValue v = (ComboValue)it.next(); if (!spec.statMatches(v.getDescriptor().getName())) { continue;
boolean loadInstance(String textId, long numericId, ResourceType type) { if (!type.isLoaded()) { return false; } if (filters == null || filters.length == 0) { return true; } else { for (int i=0; i < filters.length; i++) { if (filters[i].typeMatches(type.getName())) { if (filters[i].instanceMatches(textId, numericId)) { StatDescriptor[] stats = type.getStats(); for (int j=0; j < stats.length; j++) { if (stats[j].isLoaded()) { if (filters[i].statMatches(stats[j].getName())) { return true; } } } } } } //System.out.println("DEBUG: don't load instance=" + textId); //type.unload(); return false; } } boolean loadStat(StatDescriptor stat, ResourceInst resource) {
boolean loadInstance(String textId, long numericId, ResourceType type) { if (!type.isLoaded()) { return false; } if (filters == null || filters.length == 0) { return true; } else { for (int i=0; i < filters.length; i++) { if (filters[i].typeMatches(type.getName())) { if (filters[i].instanceMatches(textId, numericId)) { StatDescriptor[] stats = type.getStats(); for (int j=0; j < stats.length; j++) { if (stats[j].isLoaded()) { if (filters[i].statMatches(stats[j].getName())) { return true; } } } } } } //System.out.println("DEBUG: don't load instance=" + textId); //type.unload(); return false; } } boolean loadStat(StatDescriptor stat, ResourceInst resource) {
boolean loadStat(StatDescriptor stat, ResourceInst resource) { ResourceType type = resource.getType(); if (!resource.isLoaded() || !type.isLoaded() || !stat.isLoaded()) { return false; } if (filters == null || filters.length == 0) { return true; } else { String textId = resource.getName(); long numericId = resource.getId(); for (int i=0; i < filters.length; i++) { if (filters[i].statMatches(stat.getName()) && filters[i].typeMatches(type.getName()) && filters[i].instanceMatches(textId, numericId)) { return true; } } return false; } } private void readResourceTypeToken() throws IOException {
boolean loadStatDescriptor(StatDescriptor stat, ResourceType type) { // note we don't have instance data yet if (!type.isLoaded()) { return false; } if (filters == null || filters.length == 0) { return true; } else { for (int i=0; i < filters.length; i++) { if (filters[i].statMatches(stat.getName()) && filters[i].typeMatches(type.getName())) { return true; } } //System.out.println("DEBUG: don't load stat=" + stat.getName()); stat.unload(); return false; } } boolean loadInstance(String textId, long numericId, ResourceType type) {
boolean loadStatDescriptor(StatDescriptor stat, ResourceType type) { // note we don't have instance data yet if (!type.isLoaded()) { return false; } if (filters == null || filters.length == 0) { return true; } else { for (int i=0; i < filters.length; i++) { if (filters[i].statMatches(stat.getName()) && filters[i].typeMatches(type.getName())) { return true; } } //System.out.println("DEBUG: don't load stat=" + stat.getName()); stat.unload(); return false; } } boolean loadInstance(String textId, long numericId, ResourceType type) {
boolean loadStat(StatDescriptor stat, ResourceInst resource) { ResourceType type = resource.getType(); if (!resource.isLoaded() || !type.isLoaded() || !stat.isLoaded()) { return false; } if (filters == null || filters.length == 0) { return true; } else { String textId = resource.getName(); long numericId = resource.getId(); for (int i=0; i < filters.length; i++) { if (filters[i].statMatches(stat.getName()) && filters[i].typeMatches(type.getName()) && filters[i].instanceMatches(textId, numericId)) { return true; } } return false; } } private void readResourceTypeToken() throws IOException {
void matchSpec(StatSpec spec, List matchedValues) { if (spec.typeMatches(this.type.getName())) { if (spec.instanceMatches(this.getName(), this.getId())) { for (int statIdx=0; statIdx < values.length; statIdx++) { if (values[statIdx] != null) { if (spec.statMatches(values[statIdx].getDescriptor().getName())) { matchedValues.add(values[statIdx]); } } } } } }
void matchSpec(StatSpec spec, List matchedValues) { if (spec.typeMatches(this.type.getName())) { if (spec.instanceMatches(this.getName(), this.getId())) { for (int statIdx=0; statIdx < values.length; statIdx++) { if (values[statIdx] != null) { if (spec.statMatches(values[statIdx].getDescriptor().getName())) { matchedValues.add(values[statIdx]); } } } } } }