@Test public void testDump() throws Exception { Buckets<IHasShortcut> testSubject = BucketTestUtilities.makeAndPopulateTestBuckets(); BucketTestUtilities.dumpBucketsToStdout(testSubject); }
public final void dump(PrintStream ps) { List<Long> keys = new ArrayList<>(bucketList.keySet()); Collections.sort(keys); for (long k : keys) { ps.format("BUCKET: %d (%d) (%s)%n", k, k * secondsPerBucket, new Date(k * secondsPerBucket * 1000)); for (P key : bucketList.get(k).values.keySet()) { Value value = bucketList.get(k).values.get(key); ps.format(" %-40s : %10.2f (%10.2f / %d)%n", key.toString(), value.getValue(), value.getSum(), value.getCount()); } } }
Buckets { public final void dump(PrintStream ps) { List<Long> keys = new ArrayList<>(bucketList.keySet()); Collections.sort(keys); for (long k : keys) { ps.format("BUCKET: %d (%d) (%s)%n", k, k * secondsPerBucket, new Date(k * secondsPerBucket * 1000)); for (P key : bucketList.get(k).values.keySet()) { Value value = bucketList.get(k).values.get(key); ps.format(" %-40s : %10.2f (%10.2f / %d)%n", key.toString(), value.getValue(), value.getSum(), value.getCount()); } } } }
Buckets { public final void dump(PrintStream ps) { List<Long> keys = new ArrayList<>(bucketList.keySet()); Collections.sort(keys); for (long k : keys) { ps.format("BUCKET: %d (%d) (%s)%n", k, k * secondsPerBucket, new Date(k * secondsPerBucket * 1000)); for (P key : bucketList.get(k).values.keySet()) { Value value = bucketList.get(k).values.get(key); ps.format(" %-40s : %10.2f (%10.2f / %d)%n", key.toString(), value.getValue(), value.getSum(), value.getCount()); } } } Buckets();  Buckets(final long secondsPerBucket); }
Buckets { public final void dump(PrintStream ps) { List<Long> keys = new ArrayList<>(bucketList.keySet()); Collections.sort(keys); for (long k : keys) { ps.format("BUCKET: %d (%d) (%s)%n", k, k * secondsPerBucket, new Date(k * secondsPerBucket * 1000)); for (P key : bucketList.get(k).values.keySet()) { Value value = bucketList.get(k).values.get(key); ps.format(" %-40s : %10.2f (%10.2f / %d)%n", key.toString(), value.getValue(), value.getSum(), value.getCount()); } } } Buckets();  Buckets(final long secondsPerBucket); Map<Long, Bucket> getBucketList(); void addQueryStatus(P key, QueryStatus status); QueryStatus getQueryStatus(P key); final void add(final P primaryKey, final long timestamp, final double value); final void addInterpolated(final P primaryKey, final long timestamp, final double value); final Buckets<P>.Bucket getBucket(long timestamp); final SortedSet<Long> getTimestamps(); final long getSecondsPerBucket(); final void dump(PrintStream ps); }
Buckets { public final void dump(PrintStream ps) { List<Long> keys = new ArrayList<>(bucketList.keySet()); Collections.sort(keys); for (long k : keys) { ps.format("BUCKET: %d (%d) (%s)%n", k, k * secondsPerBucket, new Date(k * secondsPerBucket * 1000)); for (P key : bucketList.get(k).values.keySet()) { Value value = bucketList.get(k).values.get(key); ps.format(" %-40s : %10.2f (%10.2f / %d)%n", key.toString(), value.getValue(), value.getSum(), value.getCount()); } } } Buckets();  Buckets(final long secondsPerBucket); Map<Long, Bucket> getBucketList(); void addQueryStatus(P key, QueryStatus status); QueryStatus getQueryStatus(P key); final void add(final P primaryKey, final long timestamp, final double value); final void addInterpolated(final P primaryKey, final long timestamp, final double value); final Buckets<P>.Bucket getBucket(long timestamp); final SortedSet<Long> getTimestamps(); final long getSecondsPerBucket(); final void dump(PrintStream ps); static final long DEFAULT_BUCKET_SIZE; }