EstimatedHistogram: Add constructor from data
This patch allows to create an EstimatedHistogram from an array of data value. It will be used by the APIClient to return EstimatedHistogram Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This commit is contained in:
parent
a568e52cb5
commit
931571c3ed
@ -67,6 +67,12 @@ public class EstimatedHistogram {
|
||||
buckets = new AtomicLongArray(bucketData);
|
||||
}
|
||||
|
||||
|
||||
public EstimatedHistogram(long[] bucketData) {
|
||||
bucketOffsets = newOffsets(bucketData.length - 1);
|
||||
buckets = new AtomicLongArray(bucketData);
|
||||
}
|
||||
|
||||
private static long[] newOffsets(int size) {
|
||||
long[] result = new long[size];
|
||||
long last = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user