public void insertMetrics(List<IMetric> metrics) throws IOException {

        Collection<IMetric> simpleMetrics = new ArrayList<IMetric>();
        Collection<IMetric> preagMetrics = new ArrayList<IMetric>();
        for (IMetric metric : metrics) {
            if (metric instanceof Metric)
                simpleMetrics.add(metric);
            else if (metric instanceof PreaggregatedMetric)
                preagMetrics.add(metric);
            else {
                LOG.warn(String.format("Dont know how to insert metric of class=%s for locator=%s rollupType=%s collectionTime=%d",
                        metric.getClass().getSimpleName(), metric.getLocator(), metric.getRollupType(), metric.getCollectionTime()));
            }
        }

        if (simpleMetrics.size() > 0)
            basicMetricsRW.insertMetrics(simpleMetrics);

        if (preagMetrics.size() > 0)
            preAggrMetricsRW.insertMetrics(preagMetrics);

    }
public void insertMetrics ( List < IMetric > metrics ) throws IOException { Collection < IMetric > simpleMetrics = new ArrayList < IMetric > ( ) ; Collection < IMetric > preagMetrics = new ArrayList < IMetric > ( ) ; for ( IMetric metric : metrics ) { if ( metric instanceof Metric ) simpleMetrics . add ( metric ) ; else if ( metric instanceof PreaggregatedMetric ) preagMetrics . add ( metric ) ; else { LOG . warn ( String . format ( "Dont know how to insert metric of class=%s for locator=%s rollupType=%s collectionTime=%d" , metric . getClass ( ) . getSimpleName ( ) , metric . getLocator ( ) , metric . getRollupType ( ) , metric . getCollectionTime ( ) ) ) ; } } if ( simpleMetrics . size ( ) > 0 ) basicMetricsRW . insertMetrics ( simpleMetrics ) ; if ( preagMetrics . size ( ) > 0 ) preAggrMetricsRW . insertMetrics ( preagMetrics ) ; }
@param metrics