Details
-
Bug
-
Resolution: Fixed
-
Major
-
6.0.0, 6.0.1, 6.0.2, 6.0.3, 6.0.4, 6.0.5, 6.5.1, 6.6.0, 6.5.0
-
None
-
Untriaged
-
1
-
Yes
-
KV Sprint 2020-Oct
Description
As part of "stats reset" we call HdrHistogram::reset() which will call
void HdrHistogram::reset() {
|
hdr_reset(histogram.get());
|
}
|
but if someone is currently using the histogram in add_casted_histo_stat they'll end up with an "infinite loop" adding more and more stats:
template <typename T>
|
inline void add_casted_histo_stat(const char* k,
|
const T& v,
|
const AddStatFn& add_stat,
|
const void* cookie) {
|
if (v.getValueCount() > 0) {
|
std::string meanKey(k);
|
meanKey += "_mean";
|
add_casted_stat(
|
meanKey.c_str(), std::round(v.getMean()), add_stat, cookie);
|
|
HdrHistogram::Iterator iter{v.getHistogramsIterator()};
|
while (auto result = v.getNextBucketLowHighAndCount(iter)) {
|
if (std::get<2>(*result) > 0) {
|
std::string newKey(k);
|
newKey += "_" + std::to_string(std::get<0>(*result)) + "," +
|
std::to_string(std::get<1>(*result));
|
add_casted_stat(
|
newKey.c_str(), std::get<2>(*result), add_stat, cookie);
|
}
|
}
|
}
|
}
|