mirror of
https://github.com/grafana/grafana.git
synced 2025-02-03 12:11:09 -06:00
Minor fix in values to histogram conversion
Filter out values outside the min and max boundaries because they are assigned to uninitialized buckets (outside min and max bounds).
This commit is contained in:
parent
5ed3139d5a
commit
4cf698af10
@ -43,6 +43,10 @@ export function convertValuesToHistogram(values: number[], bucketSize: number, m
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < values.length; i++) {
|
for (let i = 0; i < values.length; i++) {
|
||||||
|
// filter out values outside the min and max boundaries
|
||||||
|
if (values[i] < min || values[i] > max) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
const bound = getBucketBound(values[i], bucketSize);
|
const bound = getBucketBound(values[i], bucketSize);
|
||||||
histogram[bound] = histogram[bound] + 1;
|
histogram[bound] = histogram[bound] + 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user