Remove meaningless statistics
Counting how many times no threads are in epoll_wait does not make sense anymore, now that threads do not share any work.
This commit is contained in:
@ -104,7 +104,6 @@ typedef struct
|
|||||||
int64_t n_polls; /*< Number of poll cycles */
|
int64_t n_polls; /*< Number of poll cycles */
|
||||||
int64_t n_pollev; /*< Number of polls returning events */
|
int64_t n_pollev; /*< Number of polls returning events */
|
||||||
int64_t n_nbpollev; /*< Number of polls returning events */
|
int64_t n_nbpollev; /*< Number of polls returning events */
|
||||||
int64_t n_nothreads; /*< Number of times no threads are polling */
|
|
||||||
int32_t n_fds[MAXNFDS]; /*< Number of wakeups with particular n_fds value */
|
int32_t n_fds[MAXNFDS]; /*< Number of wakeups with particular n_fds value */
|
||||||
int64_t evq_length; /*< Event queue length */
|
int64_t evq_length; /*< Event queue length */
|
||||||
int64_t evq_max; /*< Maximum event queue length */
|
int64_t evq_max; /*< Maximum event queue length */
|
||||||
|
@ -89,8 +89,6 @@ static volatile int *poll_msg;
|
|||||||
static void *poll_msg_data = NULL;
|
static void *poll_msg_data = NULL;
|
||||||
static SPINLOCK poll_msg_lock = SPINLOCK_INIT;
|
static SPINLOCK poll_msg_lock = SPINLOCK_INIT;
|
||||||
|
|
||||||
static int n_waiting = 0; /*< No. of threads in epoll_wait */
|
|
||||||
|
|
||||||
static void poll_check_message(void);
|
static void poll_check_message(void);
|
||||||
static bool poll_dcb_session_check(DCB *dcb, const char *function);
|
static bool poll_dcb_session_check(DCB *dcb, const char *function);
|
||||||
|
|
||||||
@ -299,13 +297,11 @@ void poll_waitevents(int epoll_fd,
|
|||||||
|
|
||||||
while (!should_shutdown(data))
|
while (!should_shutdown(data))
|
||||||
{
|
{
|
||||||
atomic_add(&n_waiting, 1);
|
|
||||||
thread_data->state = THREAD_POLLING;
|
thread_data->state = THREAD_POLLING;
|
||||||
|
|
||||||
atomic_add_int64(&poll_stats->n_polls, 1);
|
atomic_add_int64(&poll_stats->n_polls, 1);
|
||||||
if ((nfds = epoll_wait(epoll_fd, events, MAX_EVENTS, 0)) == -1)
|
if ((nfds = epoll_wait(epoll_fd, events, MAX_EVENTS, 0)) == -1)
|
||||||
{
|
{
|
||||||
atomic_add(&n_waiting, -1);
|
|
||||||
int eno = errno;
|
int eno = errno;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
MXS_DEBUG("%lu [poll_waitevents] epoll_wait returned "
|
MXS_DEBUG("%lu [poll_waitevents] epoll_wait returned "
|
||||||
@ -313,7 +309,6 @@ void poll_waitevents(int epoll_fd,
|
|||||||
pthread_self(),
|
pthread_self(),
|
||||||
nfds,
|
nfds,
|
||||||
eno);
|
eno);
|
||||||
atomic_add(&n_waiting, -1);
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* If there are no new descriptors from the non-blocking call
|
* If there are no new descriptors from the non-blocking call
|
||||||
@ -339,15 +334,6 @@ void poll_waitevents(int epoll_fd,
|
|||||||
poll_spins = 0;
|
poll_spins = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
atomic_add(&n_waiting, -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (n_waiting == 0)
|
|
||||||
{
|
|
||||||
atomic_add_int64(&poll_stats->n_nothreads, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nfds > 0)
|
if (nfds > 0)
|
||||||
{
|
{
|
||||||
@ -847,8 +833,6 @@ dprintPollStats(DCB *dcb)
|
|||||||
poll_stats_get(&POLL_STATS::n_hup, TS_STATS_SUM));
|
poll_stats_get(&POLL_STATS::n_hup, TS_STATS_SUM));
|
||||||
dcb_printf(dcb, "No. of accept events: %" PRId64 "\n",
|
dcb_printf(dcb, "No. of accept events: %" PRId64 "\n",
|
||||||
poll_stats_get(&POLL_STATS::n_accept, TS_STATS_SUM));
|
poll_stats_get(&POLL_STATS::n_accept, TS_STATS_SUM));
|
||||||
dcb_printf(dcb, "No. of times no threads polling: %" PRId64 "\n",
|
|
||||||
poll_stats_get(&POLL_STATS::n_nothreads, TS_STATS_SUM));
|
|
||||||
dcb_printf(dcb, "Total event queue length: %" PRId64 "\n",
|
dcb_printf(dcb, "Total event queue length: %" PRId64 "\n",
|
||||||
poll_stats_get(&POLL_STATS::evq_length, TS_STATS_AVG));
|
poll_stats_get(&POLL_STATS::evq_length, TS_STATS_AVG));
|
||||||
dcb_printf(dcb, "Average event queue length: %" PRId64 "\n",
|
dcb_printf(dcb, "Average event queue length: %" PRId64 "\n",
|
||||||
|
Reference in New Issue
Block a user