blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/datastax/DPreaggregatedMetricsRW.java
@VisibleForTesting
    @Override
    public void insertMetrics(Collection<IMetric> metrics,
                              Granularity granularity) throws IOException {

        Timer.Context ctx = Instrumentation.getWriteTimerContext(
                CassandraModel.getPreaggregatedColumnFamilyName(granularity));
        try {
            Multimap<Locator, IMetric> map = asMultimap(metrics);

            if ( isBatchIngestEnabled ) {
                insertMetricsInBatch(map, granularity);
            } else {
                insertMetricsIndividually(map, granularity);
            }
        } finally {
            ctx.stop();
        }
    }
@VisibleForTesting
    @Override
    public void insertMetrics(Collection<IMetric> metrics,
                              Granularity granularity) throws IOException {

        Timer.Context ctx = Instrumentation.getWriteTimerContext(
                CassandraModel.getPreaggregatedColumnFamilyName(granularity));
        try {
            Multimap<Locator, IMetric> map = asMultimap(metrics);

            if ( isBatchIngestEnabled ) {
                insertMetricsInBatch(map, granularity);
            } else {
                insertMetricsIndividually(map, granularity);
            }
        } finally {
            ctx.stop();
        }
    }
@ VisibleForTesting @ Override public void insertMetrics ( Collection < IMetric > metrics , Granularity granularity ) throws IOException { Timer . Context ctx = Instrumentation . getWriteTimerContext ( CassandraModel . getPreaggregatedColumnFamilyName ( granularity ) ) ; try { Multimap < Locator , IMetric > map = asMultimap ( metrics ) ; if ( isBatchIngestEnabled ) { insertMetricsInBatch ( map , granularity ) ; } else { insertMetricsIndividually ( map , granularity ) ; } } finally { ctx . stop ( ) ; } }
Inserts a collection of rolled up metrics to the metrics_preaggregated_{granularity} column family.
Only our tests should call this method. Services should call either insertMetrics(Collection metrics)
or insertRollups()

@param metrics
@throws IOException
Inserts a collection of rolled up metrics to the metrics_preaggregated_ { granularity } column family . Only our tests should call this method . Services should call either insertMetrics ( Collection metrics ) or insertRollups ()