Fixup for perf_meter.hpp

Don't try to push reports if they are empty.
This commit is contained in:
Nekotekina 2020-10-19 21:25:40 +03:00
parent 72d1ac22aa
commit ea8e435b32
1 changed files with 7 additions and 3 deletions

View File

@ -7,8 +7,6 @@
#include "IdManager.h"
#include <array>
#include <cmath>
#include <thread>
#include <unordered_map>
LOG_CHANNEL(perf_log, "PERF");
@ -55,7 +53,13 @@ class perf_stat final : public perf_stat_base
~perf_stat_local()
{
// Update on thread exit
g_fxo->get<perf_stat>()->perf_stat_base::push(m_log);
if (m_log[0])
{
if (auto* pfs = g_fxo->get<perf_stat>())
{
pfs->perf_stat_base::push(m_log);
}
}
}
} g_tls_perf_stat;