Don't include zero traffic levels

This commit is contained in:
JoelKatz
2015-11-20 14:37:14 -08:00
committed by Nik Bougalis
parent 9f96d7ea38
commit 3c496b07f9

View File

@@ -53,6 +53,11 @@ public:
, messagesIn (ts.messagesIn.load())
, messagesOut (ts.messagesOut.load())
{ ; }
operator bool () const
{
return messagesIn || messagesOut;
}
};
@@ -107,9 +112,10 @@ public:
for (auto& i : counts_)
{
ret.emplace (std::piecewise_construct,
std::forward_as_tuple (getName (i.first)),
std::forward_as_tuple (i.second));
if (i.second)
ret.emplace (std::piecewise_construct,
std::forward_as_tuple (getName (i.first)),
std::forward_as_tuple (i.second));
}
return ret;