final StatSpec[] filters = new StatSpec[] { statSpec }; final StatArchiveReader reader = new StatArchiveReader(archiveFiles, filters, true); final StatValue[] values = reader.matchSpec(statSpec); return values;
/** * Returns an array of stat values that match the specified spec. * If nothing matches then an empty array is returned. */ public StatValue[] matchSpec(StatSpec spec) { if (spec.getCombineType() == StatSpec.GLOBAL) { StatValue[] allValues = matchSpec(new RawStatSpec(spec)); if (allValues.length == 0) { return allValues; } else { ComboValue cv = new ComboValue(allValues); // need to save this in reader's combo value list return new StatValue[]{cv}; } } else { List l = new ArrayList(); StatArchiveReader.StatArchiveFile[] archives = getArchives(); for (int i=0; i < archives.length; i++) { StatArchiveFile f = archives[i]; if (spec.archiveMatches(f.getFile())) { f.matchSpec(spec, l); } } StatValue[] result = new StatValue[l.size()]; return (StatValue[])l.toArray(result); } }
/** * Returns an array of stat values that match the specified spec. * If nothing matches then an empty array is returned. */ public StatValue[] matchSpec(StatSpec spec) { if (spec.getCombineType() == StatSpec.GLOBAL) { StatValue[] allValues = matchSpec(new RawStatSpec(spec)); if (allValues.length == 0) { return allValues; } else { ComboValue cv = new ComboValue(allValues); // need to save this in reader's combo value list return new StatValue[]{cv}; } } else { List l = new ArrayList(); StatArchiveReader.StatArchiveFile[] archives = getArchives(); for (int i=0; i < archives.length; i++) { StatArchiveFile f = archives[i]; if (spec.archiveMatches(f.getFile())) { f.matchSpec(spec, l); } } StatValue[] result = new StatValue[l.size()]; return (StatValue[])l.toArray(result); } }
Map<CombinedResources, List<StatValue>> allSpecsMap = new HashMap<CombinedResources, List<StatValue>>(); for (int i=0; i < specs.length; i++) { StatValue[] values = reader.matchSpec(specs[i]); if (values.length == 0) { if (!quiet) {
Map<CombinedResources, List<StatValue>> allSpecsMap = new HashMap<CombinedResources, List<StatValue>>(); for (int i=0; i < specs.length; i++) { StatValue[] values = reader.matchSpec(specs[i]); if (values.length == 0) { if (!quiet) {
/** * For internal use only. * <p> * Fetches, trims, and converts the matching statistics using the reader. */ private List readStatistics( StatSpec statspec, TrimSpec trimspec, StatArchiveReader reader ) { List psvs = new ArrayList(); StatArchiveReader.StatValue[] values = reader.matchSpec( statspec ); if ( Log.getLogWriter().finerEnabled() ) { Log.getLogWriter().finer( "Values: " + values ); } for ( int i = 0; i < values.length; i++ ) { StatArchiveReader.StatValue sv = values[i]; if ( Log.getLogWriter().finerEnabled() ) { Log.getLogWriter().finer( "Value: " + sv.toString() ); } PerfStatValue psv = PerfStatReader.getPerfStatValue( statspec, trimspec, sv ); psvs.add( psv ); } if ( Log.getLogWriter().finerEnabled() ) { Log.getLogWriter().finer( "PerfStatValues: " + psvs ); } return psvs.size() == 0 ? null : psvs; }
while (it.hasNext()) { StatSpec spec = (StatSpec)it.next(); StatArchiveReader.StatValue[] values = reader.matchSpec(spec); if (Log.getLogWriter().finestEnabled()) { for (int i = 0; i < values.length; i++) {