This commit is contained in:
Patrick Brosi 2022-02-07 09:35:28 +01:00
parent 13b6436a41
commit e15b90af9f

View file

@ -394,6 +394,8 @@ std::map<string, double> Collector::getStats() {
if (_distDiffs.size()) { if (_distDiffs.size()) {
auto i = _distDiffs.begin() + _distDiffs.size() / 2; auto i = _distDiffs.begin() + _distDiffs.size() / 2;
// std::nth_element makes a partial sort of the first n elements
std::nth_element(_distDiffs.begin(), i, _distDiffs.end()); std::nth_element(_distDiffs.begin(), i, _distDiffs.end());
stats["median-dist-diff"] = *i; stats["median-dist-diff"] = *i;