show tunnels queue size

This commit is contained in:
orignal 2015-02-03 16:45:19 -05:00
parent cd8e9e59fa
commit 14f448f4c7
3 changed files with 10 additions and 1 deletions

View File

@ -751,6 +751,8 @@ namespace util
void HTTPConnection::ShowTunnels (std::stringstream& s)
{
s << "Queue size:" << i2p::tunnel::tunnels.GetQueueSize () << "<br>";
for (auto it: i2p::tunnel::tunnels.GetOutboundTunnels ())
{
it->GetTunnelConfig ()->Print (s);

View File

@ -76,7 +76,13 @@ namespace util
std::unique_lock<std::mutex> l(m_QueueMutex);
return m_Queue.empty ();
}
int GetSize ()
{
std::unique_lock<std::mutex> l(m_QueueMutex);
return m_Queue.size ();
}
void WakeUp () { m_NonEmpty.notify_all (); };
Element * Get ()

View File

@ -181,6 +181,7 @@ namespace tunnel
const decltype(m_OutboundTunnels)& GetOutboundTunnels () const { return m_OutboundTunnels; };
const decltype(m_InboundTunnels)& GetInboundTunnels () const { return m_InboundTunnels; };
const decltype(m_TransitTunnels)& GetTransitTunnels () const { return m_TransitTunnels; };
int GetQueueSize () { return m_Queue.GetSize (); };
};
extern Tunnels tunnels;