comment
This commit is contained in:
parent
13b6436a41
commit
e15b90af9f
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue