protected Metric reduce(List<Metric> metrics){
  SystemAssert.requireArgument(metrics != null,"Cannot transform empty metric/metrics");
  MetricDistiller distiller=new MetricDistiller();
  distiller.distill(metrics);
  Map<Long,List<String>> collated=collate(metrics);
  Map<Long,String> minDatapoints=reduce(collated,metrics);
  String newMetricName=distiller.getMetric() == null ? defaultMetricName : distiller.getMetric();
  Metric newMetric=new Metric(defaultScope,newMetricName);
  newMetric.setDisplayName(distiller.getDisplayName());
  newMetric.setUnits(distiller.getUnits());
  newMetric.setTags(distiller.getTags());
  newMetric.setDatapoints(minDatapoints);
  return newMetric;
}

protected Metric reduce ( List < Metric > metrics ) { SystemAssert . requireArgument ( metrics != null , "Cannot transform empty metric/metrics" ) ; MetricDistiller distiller = new MetricDistiller ( ) ; distiller . distill ( metrics ) ; Map < Long , List < String > > collated = collate ( metrics ) ; Map < Long , String > minDatapoints = reduce ( collated , metrics ) ; String newMetricName = distiller . getMetric ( ) == null ? defaultMetricName : distiller . getMetric ( ) ; Metric newMetric = new Metric ( defaultScope , newMetricName ) ; newMetric . setDisplayName ( distiller . getDisplayName ( ) ) ; newMetric . setUnits ( distiller . getUnits ( ) ) ; newMetric . setTags ( distiller . getTags ( ) ) ; newMetric . setDatapoints ( minDatapoints ) ; return newMetric ; }
reduce transform for the list of metrics .
