Map<String, PerformanceSample[]> result = new HashMap<String, PerformanceSample[]>();
if (metricBase != null && metricBase.length > 0) {
for (EntityMetricBase perf : metricBase) {
EntityMetric stats = ((EntityMetric) perf);
if (stats.getValue() != null && stats.getSampleInfo() != null) {
IntSeries samples = (IntSeries) stats.getValue()[0];
if (samples != null) {
int numSamples = samples.getValue().length;
List<PerformanceSample> vals = new ArrayList<PerformanceSample>();
for (int i = 0; i < numSamples; i++) {
if (samples.getValue()[i] >= 0) {
PerformanceSample output = new PerformanceSample();
output.sample = samples.getValue()[i];
output.timestamp = stats.getSampleInfo()[i].getTimestamp();
ElementDescription desc = counters.map.get(samples.getId().getCounterId()).getUnitInfo();
output.unit = desc.getLabel();
vals.add(output);
}
}
if (vals.size() > 0) {