mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 11:04:00 +01: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);
|
||||
|
|
6
Queue.h
6
Queue.h
|
@ -77,6 +77,12 @@ namespace util
|
|||
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 a new issue