1
1
Fork 0
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:
Thomas Winget 2019-11-28 18:33:50 -05:00 committed by Jason Rhinelander
parent 6acf7bff7e
commit 6d506302dc
2 changed files with 12 additions and 3 deletions

View file

@ -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

View file

@ -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;