0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-18 07:50:57 +01:00

irct::ctx: Add this basic pool debug.

This commit is contained in:
Jason Volk 2017-10-19 00:58:43 -07:00
parent 0fe97a2ed5
commit c157967559
2 changed files with 15 additions and 0 deletions

View file

@ -72,6 +72,8 @@ struct ircd::ctx::pool
pool &operator=(pool &&) = delete; pool &operator=(pool &&) = delete;
pool &operator=(const pool &) = delete; pool &operator=(const pool &) = delete;
~pool() noexcept; ~pool() noexcept;
friend void debug_stats(const pool &);
}; };
template<class F, template<class F,

View file

@ -733,6 +733,19 @@ catch(const std::exception &e)
e.what()); e.what());
} }
void
ircd::ctx::debug_stats(const pool &pool)
{
log::debug("pool '%s' (stack size: %zu) total: %zu avail: %zu queued: %zu active: %zu pending: %zu",
pool.name,
pool.stack_size,
pool.size(),
pool.avail(),
pool.queued(),
pool.active(),
pool.pending());
}
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// //
// ctx_prof.h // ctx_prof.h