mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-28 10:41:12 +00:00
API: When combining histogram, return zeroed histogram on empty
This change make sure that when there are no results (ie. all the histogram that are summed are empty) the return result will be a zerroed histogram and not an empty object. Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This commit is contained in:
@@ -111,13 +111,13 @@ inline double pow2(double a) {
|
||||
|
||||
inline httpd::utils_json::histogram add_histogram(httpd::utils_json::histogram res,
|
||||
const utils::ihistogram& val) {
|
||||
if (val.count == 0) {
|
||||
return res;
|
||||
}
|
||||
if (!res.count._set) {
|
||||
res = val;
|
||||
return res;
|
||||
}
|
||||
if (val.count == 0) {
|
||||
return res;
|
||||
}
|
||||
if (res.min() > val.min) {
|
||||
res.min = val.min;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user