RecentEstimatedHistogram: Support empty histogram
The RecentEstimatedHistogram updates its value from the API with an array of recent values. This array can be empty, in that case the getBuckets method should just return a zero size array. Signed-off-by: Amnon Heiman <amnon@scylladb.com>
This commit is contained in:
parent
e0dea0c27e
commit
695e23bd4e
@ -50,6 +50,9 @@ public class RecentEstimatedHistogram extends EstimatedHistogram {
|
||||
* @return a long[] containing the current histogram difference buckets
|
||||
*/
|
||||
public long[] getBuckets(long[] bucketData) {
|
||||
if (bucketData.length == 0) {
|
||||
return new long[0];
|
||||
}
|
||||
final int len = buckets.length();
|
||||
long[] rv = new long[len];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user