@Test(expected = NullPointerException.class) public void rawSampleBuilderWithNullInputsThrowsException() throws IOException { BluefloodCounterRollup rollup = BluefloodCounterRollup.buildRollupFromRawSamples(null); }
public static BluefloodCounterRollup buildRollupFromRawSamples(Points<SimpleNumber> input) throws IOException { long minTime = Long.MAX_VALUE; long maxTime = Long.MIN_VALUE; BluefloodCounterRollup rollup = new BluefloodCounterRollup(); Number count = 0L; for (Points.Point<SimpleNumber> point : input.getPoints().values()) { count = sum(count, point.getData().getValue()); minTime = Math.min(minTime, point.getTimestamp()); maxTime = Math.max(maxTime, point.getTimestamp()); } double numSeconds = (double)(maxTime - minTime); double rate = count.doubleValue() / numSeconds; return rollup.withCount(count).withRate(rate).withSampleCount(input.getPoints().size()); }
BluefloodCounterRollup implements Rollup { public static BluefloodCounterRollup buildRollupFromRawSamples(Points<SimpleNumber> input) throws IOException { long minTime = Long.MAX_VALUE; long maxTime = Long.MIN_VALUE; BluefloodCounterRollup rollup = new BluefloodCounterRollup(); Number count = 0L; for (Points.Point<SimpleNumber> point : input.getPoints().values()) { count = sum(count, point.getData().getValue()); minTime = Math.min(minTime, point.getTimestamp()); maxTime = Math.max(maxTime, point.getTimestamp()); } double numSeconds = (double)(maxTime - minTime); double rate = count.doubleValue() / numSeconds; return rollup.withCount(count).withRate(rate).withSampleCount(input.getPoints().size()); } }
BluefloodCounterRollup implements Rollup { public static BluefloodCounterRollup buildRollupFromRawSamples(Points<SimpleNumber> input) throws IOException { long minTime = Long.MAX_VALUE; long maxTime = Long.MIN_VALUE; BluefloodCounterRollup rollup = new BluefloodCounterRollup(); Number count = 0L; for (Points.Point<SimpleNumber> point : input.getPoints().values()) { count = sum(count, point.getData().getValue()); minTime = Math.min(minTime, point.getTimestamp()); maxTime = Math.max(maxTime, point.getTimestamp()); } double numSeconds = (double)(maxTime - minTime); double rate = count.doubleValue() / numSeconds; return rollup.withCount(count).withRate(rate).withSampleCount(input.getPoints().size()); } BluefloodCounterRollup(); }
BluefloodCounterRollup implements Rollup { public static BluefloodCounterRollup buildRollupFromRawSamples(Points<SimpleNumber> input) throws IOException { long minTime = Long.MAX_VALUE; long maxTime = Long.MIN_VALUE; BluefloodCounterRollup rollup = new BluefloodCounterRollup(); Number count = 0L; for (Points.Point<SimpleNumber> point : input.getPoints().values()) { count = sum(count, point.getData().getValue()); minTime = Math.min(minTime, point.getTimestamp()); maxTime = Math.max(maxTime, point.getTimestamp()); } double numSeconds = (double)(maxTime - minTime); double rate = count.doubleValue() / numSeconds; return rollup.withCount(count).withRate(rate).withSampleCount(input.getPoints().size()); } BluefloodCounterRollup(); BluefloodCounterRollup withCount(Number count); BluefloodCounterRollup withRate(double rate); BluefloodCounterRollup withSampleCount(int sampleCount); Number getCount(); double getRate(); int getSampleCount(); @Override String toString(); @Override boolean equals(Object obj); static BluefloodCounterRollup buildRollupFromRawSamples(Points<SimpleNumber> input); static BluefloodCounterRollup buildRollupFromCounterRollups(Points<BluefloodCounterRollup> input); @Override Boolean hasData(); @Override RollupType getRollupType(); }
BluefloodCounterRollup implements Rollup { public static BluefloodCounterRollup buildRollupFromRawSamples(Points<SimpleNumber> input) throws IOException { long minTime = Long.MAX_VALUE; long maxTime = Long.MIN_VALUE; BluefloodCounterRollup rollup = new BluefloodCounterRollup(); Number count = 0L; for (Points.Point<SimpleNumber> point : input.getPoints().values()) { count = sum(count, point.getData().getValue()); minTime = Math.min(minTime, point.getTimestamp()); maxTime = Math.max(maxTime, point.getTimestamp()); } double numSeconds = (double)(maxTime - minTime); double rate = count.doubleValue() / numSeconds; return rollup.withCount(count).withRate(rate).withSampleCount(input.getPoints().size()); } BluefloodCounterRollup(); BluefloodCounterRollup withCount(Number count); BluefloodCounterRollup withRate(double rate); BluefloodCounterRollup withSampleCount(int sampleCount); Number getCount(); double getRate(); int getSampleCount(); @Override String toString(); @Override boolean equals(Object obj); static BluefloodCounterRollup buildRollupFromRawSamples(Points<SimpleNumber> input); static BluefloodCounterRollup buildRollupFromCounterRollups(Points<BluefloodCounterRollup> input); @Override Boolean hasData(); @Override RollupType getRollupType();  }