mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 00:00:29 +03:00
show tunnels queue size
This commit is contained in:
parent
cd8e9e59fa
commit
14f448f4c7
@ -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);
|
||||
|
8
Queue.h
8
Queue.h
@ -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 ()
|
||||
|
1
Tunnel.h
1
Tunnel.h
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user