From fae86d66485c76f1abb3cdb8cf53f9eeec3129b4 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Thu, 19 May 2016 08:04:23 +0200 Subject: [PATCH] Fix strange ten minute stats pattern. --- src/controller/controller_statistics.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/controller/controller_statistics.cpp b/src/controller/controller_statistics.cpp index 7db194b1..c5701b6a 100644 --- a/src/controller/controller_statistics.cpp +++ b/src/controller/controller_statistics.cpp @@ -291,6 +291,18 @@ void Controller::statSession::wipeOld(unsigned long long cutOff){ oldConns.pop_front(); } } + if (curConns.size()){ + for (std::map::iterator it = curConns.begin(); it != curConns.end(); ++it){ + while (it->second.log.size() > 1 && it->second.log.begin()->first < cutOff){ + it->second.log.erase(it->second.log.begin()); + } + if (it->second.log.size()){ + if (firstSec > it->second.log.begin()->first){ + firstSec = it->second.log.begin()->first; + } + } + } + } } /// Archives the given connection.