mirror of
https://github.com/oxen-io/lokinet
synced 2023-12-14 06:53:00 +01:00
Show number of logic thread jobs in debug builds
This commit is contained in:
parent
6acf7bff7e
commit
6d506302dc
|
@ -841,11 +841,12 @@ namespace libuv
|
|||
if(m_Run)
|
||||
{
|
||||
#ifdef LOKINET_DEBUG
|
||||
if ((uv_now(&m_Impl) - last_time) > 1000)
|
||||
if((uv_now(&m_Impl) - last_time) > 1000)
|
||||
{
|
||||
llarp::LogInfo("UV EVENT LOOP TICKS LAST SECOND: ", loop_run_count);
|
||||
llarp::LogInfo("UV EVENT LOOP TICKS LAST SECOND: ", loop_run_count,
|
||||
", LOGIC THREAD JOBS: ", m_Logic->pendingThreadJobs());
|
||||
loop_run_count = 0;
|
||||
last_time = uv_now(&m_Impl);
|
||||
last_time = uv_now(&m_Impl);
|
||||
}
|
||||
loop_run_count++;
|
||||
#endif
|
||||
|
|
|
@ -45,6 +45,14 @@ namespace llarp
|
|||
bool
|
||||
can_flush() const;
|
||||
|
||||
#ifdef LOKINET_DEBUG
|
||||
size_t
|
||||
pendingThreadJobs() const
|
||||
{
|
||||
return m_Thread->pendingJobs();
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
using ID_t = std::thread::id;
|
||||
llarp_threadpool* const m_Thread;
|
||||
|
|
Loading…
Reference in a new issue