IMetric metric = new PreaggregatedMetric(ts, locator, ttl, simple);
writer.insertMetrics(Lists.newArrayList(metric), CassandraModel.CF_METRICS_PREAGGREGATED_FULL);
// read the raw data.
Points<TimerRollup> points = PreaggregatedMetricsIntegrationTest.getTimerDataToRoll(reader, locator, new Range(ts, ts+1), Granularity.FULL);
Assert.assertEquals(1, points.getPoints().size());
// create the rollup
final TimerRollup rollup = TimerRollup.buildRollupFromTimerRollups(points);
// should be the same as simple
Assert.assertEquals(simple, rollup);
// assemble it into points, but give it a new timestamp.
points = new Points<TimerRollup>() {{
add(new Point<TimerRollup>(rollupTs, rollup));
}};
List<IMetric> toWrite = toIMetricsList(locator, points);
writer.insertMetrics(toWrite, CassandraModel.CF_METRICS_PREAGGREGATED_5M);
// we should be able to read that now.
Points<TimerRollup> rollups5m = reader.getDataToRoll(TimerRollup.class, locator, new Range(rollupTs, rollupTs+1), CassandraModel.CF_METRICS_PREAGGREGATED_5M);
Assert.assertEquals(1, rollups5m.getPoints().size());
TimerRollup rollup5m = rollups5m.getPoints().values().iterator().next().getData();
// rollups should be identical since one is just a coarse rollup of the other.