dbms: fix possible counter value loss between difference calculcation and store. [#METR-10463]

This commit is contained in:
Andrey Mironov 2014-07-22 13:03:25 +04:00
parent 9bb88d4db2
commit fbf6225911

View File

@ -82,8 +82,9 @@ private:
for (auto i = 0; i < ProfileEvents::END; ++i)
{
const auto counter_increment = ProfileEvents::counters[i] - prev_counters[i];
prev_counters[i] = ProfileEvents::counters[i];
const auto counter = ProfileEvents::counters[i];
const auto counter_increment = counter - prev_counters[i];
prev_counters[i] = counter;
std::string key{ProfileEvents::getDescription(static_cast<ProfileEvents::Event>(i))};
std::replace(std::begin(key), std::end(key), ' ', '_');