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) {
while (it.hasNext()) { ComboValue v = (ComboValue) it.next(); if (!spec.statMatches(v.getDescriptor().getName())) { continue;
/** * Computes a name for the provided measurement field. * @param measurementField field to compute the measurement name for. * @return Returns a measurement name for the provided measurementField */ public String getMeasurementFieldName(StatArchiveReader.StatValue measurementField) { return measurementField.getDescriptor().getName(); }
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++) { "Cannot combine values with different types."); if (!statName.equals(this.values[i].getDescriptor().getName())) { throw new IllegalArgumentException( "Cannot combine different stats.");
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; } } } } } } return false; } }
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; } }
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; } } stat.unload(); return false; } }
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]); } } } } } }