CountersByType counters = getCountersOfType(type, targetIds.get(0));
MetricId[] metrics = getMatchingMetrics(targetMOB.get(0), counters, sampleInterval);
// construct query spec
QuerySpec[] specs = new QuerySpecImpl[targetMOB.size()];
for (int i = 0; i < targetMOB.size(); i++) {
specs[i] = new QuerySpecImpl();
specs[i].setEntity(targetMOB.get(i));
specs[i].setIntervalId(sampleInterval);
specs[i].setFormat("normal");
specs[i].setMetricId(metrics);
// selection of samples (historical)