MXS-1823 Replace meaningless eventq info with meaningful

The evq_length file held the returned number of descriptors from
the last epoll_wait() call. As such it is highly temporal and not
particularly meaningful.

That has now been removed and the instead the average number of
returned descriptors is maintained. That information changes slowly
and thus carries some meaning.
This commit is contained in:
Johan Wikman
2018-06-28 11:56:55 +03:00
parent d339b89990
commit c89bdb9626
6 changed files with 28 additions and 13 deletions

View File

@ -689,6 +689,9 @@ void Worker::poll_waitevents()
m_load.reset();
int64_t nFds_total = 0;
int64_t nPolls_effective = 0;
while (!should_shutdown())
{
int nfds;
@ -724,7 +727,18 @@ void Worker::poll_waitevents()
if (nfds > 0)
{
m_statistics.evq_length = nfds;
nPolls_effective += 1;
nFds_total += nfds;
if (nFds_total <= 0)
{
// Wrapped, so we reset the situation.
nFds_total = nfds;
nPolls_effective = 1;
}
m_statistics.evq_avg = nFds_total / nPolls_effective;
if (nfds > m_statistics.evq_max)
{
m_statistics.evq_max = nfds;