@Test public void testAdd() throws Exception { Buckets<IHasShortcut> testSubject = makeTestBuckets(); testSubject.add(MetricKey.fromValue("", "", ""), 123, 1.234); testSubject.add(MetricKey.fromValue("My.Metric.Formal.Name", "MyMetric", "Foo=Bar"), 123, 4.567); Buckets.Bucket bucket = testSubject.getBucket(123); assertEquals("getValueByShortcut should return the value put in with that shortcut", bucket.getValueByShortcut("").getValue(), 1.234, EPSILON); assertEquals("getValueByShortcut should return the value put in with that shortcut", bucket.getValueByShortcut("My.Metric.Formal.Name").getValue(), 4.567, EPSILON); }
public final void add(final P primaryKey, final long timestamp, final double value) { long ts = getBucketTimestamp(timestamp); Bucket b = bucketList.get(ts); if (b == null) { b = new Bucket(); bucketList.put(ts, b); } b.add(primaryKey, value); }
Buckets { public final void add(final P primaryKey, final long timestamp, final double value) { long ts = getBucketTimestamp(timestamp); Bucket b = bucketList.get(ts); if (b == null) { b = new Bucket(); bucketList.put(ts, b); } b.add(primaryKey, value); } }
Buckets { public final void add(final P primaryKey, final long timestamp, final double value) { long ts = getBucketTimestamp(timestamp); Bucket b = bucketList.get(ts); if (b == null) { b = new Bucket(); bucketList.put(ts, b); } b.add(primaryKey, value); } Buckets();  Buckets(final long secondsPerBucket); }
Buckets { public final void add(final P primaryKey, final long timestamp, final double value) { long ts = getBucketTimestamp(timestamp); Bucket b = bucketList.get(ts); if (b == null) { b = new Bucket(); bucketList.put(ts, b); } b.add(primaryKey, value); } 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 add(final P primaryKey, final long timestamp, final double value) { long ts = getBucketTimestamp(timestamp); Bucket b = bucketList.get(ts); if (b == null) { b = new Bucket(); bucketList.put(ts, b); } b.add(primaryKey, value); } 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; }