Removed unnecessary calls to atomic_add

The polling statistics collection used atomic_add to increment values. This
is not an optimal way to update statistical values. Moved to per thread
values which are summed up when they are read.

Moved the functions used to gather polling statistics to their own file and
created a specific data type for statistics.
This commit is contained in:
Markus Makela
2016-01-16 06:06:35 +02:00
parent 5e8ba4b519
commit 743a1b1037
7 changed files with 239 additions and 43 deletions

View File

@ -89,6 +89,7 @@
#include <sys/wait.h>
#include <sys/prctl.h>
#include <sys/file.h>
#include <statistics.h>
#define STRING_BUFFER_SIZE 1024
#define PIDFD_CLOSED -1
@ -1917,6 +1918,9 @@ int main(int argc, char **argv)
goto return_main;
}
/** Initialize statistics */
ts_stats_init();
/* Init MaxScale poll system */
poll_init();