Map<String,Object> rdata = new HashMap<String, Object>();
rdata.put("LABEL", label);
for (int i = 0; i < samples.size(); i++) {
PerfSample sample = samples.get(i);
if (sample != null) {
Number val = sample.getValue();
rdata.put("LVAL"+i, val.longValue());
rdata.put("DVAL"+i, val.doubleValue());
QueryResult rslt = (QueryResult)sample.getResult();
if (!rdata.containsKey("ATTR")) { rdata.put("ATTR", rslt.getAttrs()); }
MetricTemplate mt = sample.getMetric().getTemplate();
rdata.put("UNIT"+i, mt.getUnits());
} else {
rdata.put("LVAL"+i, 0L);
rdata.put("DVAL"+i, 0.0);
}