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.
		
			
				
	
	
		
			23 lines
		
	
	
		
			403 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			403 B
		
	
	
	
		
			C
		
	
	
	
	
	
#ifndef TEST_UTILS_H
 | 
						|
#define TEST_UTILS_H
 | 
						|
#include <poll.h>
 | 
						|
#include <dcb.h>
 | 
						|
#include <housekeeper.h>
 | 
						|
#include <maxscale_test.h>
 | 
						|
#include <log_manager.h>
 | 
						|
#include <statistics.h>
 | 
						|
 | 
						|
void init_test_env(char *path)
 | 
						|
{
 | 
						|
    int argc = 3;
 | 
						|
 | 
						|
    const char* logdir = path ? path : TEST_LOG_DIR;
 | 
						|
 | 
						|
    ts_stats_init();
 | 
						|
    mxs_log_init(NULL, logdir, MXS_LOG_TARGET_DEFAULT);
 | 
						|
    poll_init();
 | 
						|
    hkinit();
 | 
						|
}
 | 
						|
 | 
						|
#endif
 |