public static Collection<Metric> remarshal(Collection<BasicMetric> basicMetrics, String tenantId) {
List<Metric> metrics = new ArrayList<Metric>(basicMetrics.size());
for (BasicMetric bm : basicMetrics) {
String appliedTenantId = tenantId == null ? bm.getTenant() : tenantId;
Locator locator = Locator.createLocatorFromPathComponents(appliedTenantId, splitForLocator(bm.getMetricName()));
Metric m = new Metric(locator, bm.getMetricValue(), bm.getCollectionTime(), new TimeValue(bm.getTtlInSeconds(), TimeUnit.SECONDS), bm.getUnit());
metrics.add(m);
}
return metrics;
}