Use new functions for accessing start- and uptime.
This commit is contained in:
		| @ -45,6 +45,7 @@ | |||||||
| #include <atomic.h> | #include <atomic.h> | ||||||
| #include <spinlock.h> | #include <spinlock.h> | ||||||
| #include <dcb.h> | #include <dcb.h> | ||||||
|  | #include <maxscale.h> | ||||||
| #include <maxscale/poll.h> | #include <maxscale/poll.h> | ||||||
| #include <maxinfo.h> | #include <maxinfo.h> | ||||||
| #include <skygw_utils.h> | #include <skygw_utils.h> | ||||||
| @ -430,11 +431,10 @@ maxinfo_statistics(INFO_INSTANCE *router, INFO_SESSION *session, GWBUF *queue) | |||||||
| char	result[1000], *ptr; | char	result[1000], *ptr; | ||||||
| GWBUF	*ret; | GWBUF	*ret; | ||||||
| int	len; | int	len; | ||||||
| extern	int	MaxScaleUptime(); |  | ||||||
|  |  | ||||||
| 	snprintf(result, 1000, | 	snprintf(result, 1000, | ||||||
| 		"Uptime: %u  Threads: %u  Sessions: %u ", | 		"Uptime: %u  Threads: %u  Sessions: %u ", | ||||||
| 			MaxScaleUptime(), | 			maxscale_uptime(), | ||||||
| 			config_threadcount(), | 			config_threadcount(), | ||||||
| 			serviceSessionCountAll()); | 			serviceSessionCountAll()); | ||||||
| 	if ((ret = gwbuf_alloc(4 + strlen(result))) == NULL) | 	if ((ret = gwbuf_alloc(4 + strlen(result))) == NULL) | ||||||
| @ -540,7 +540,7 @@ static char	buf[40]; | |||||||
| 	{ | 	{ | ||||||
| 		(*context)++; | 		(*context)++; | ||||||
| 		row = resultset_make_row(result); | 		row = resultset_make_row(result); | ||||||
| 		sprintf(buf, "%u", (unsigned int)MaxScaleStarted); | 		sprintf(buf, "%u", (unsigned int)maxscale_started()); | ||||||
| 		resultset_row_set(row, 0, buf); | 		resultset_row_set(row, 0, buf); | ||||||
| 		return row; | 		return row; | ||||||
| 	} | 	} | ||||||
|  | |||||||
| @ -42,6 +42,7 @@ | |||||||
| #include <atomic.h> | #include <atomic.h> | ||||||
| #include <spinlock.h> | #include <spinlock.h> | ||||||
| #include <dcb.h> | #include <dcb.h> | ||||||
|  | #include <maxscale.h> | ||||||
| #include <maxscale/poll.h> | #include <maxscale/poll.h> | ||||||
| #include <maxinfo.h> | #include <maxinfo.h> | ||||||
| #include <skygw_utils.h> | #include <skygw_utils.h> | ||||||
| @ -776,8 +777,6 @@ getMaxScaleHome() | |||||||
| #define	VT_STRING	1 | #define	VT_STRING	1 | ||||||
| #define	VT_INT		2 | #define	VT_INT		2 | ||||||
|  |  | ||||||
| extern int MaxScaleUptime(); |  | ||||||
|  |  | ||||||
| typedef void *(*STATSFUNC)(); | typedef void *(*STATSFUNC)(); | ||||||
| /** | /** | ||||||
|  * Variables that may be sent in a show variables |  * Variables that may be sent in a show variables | ||||||
| @ -794,7 +793,7 @@ static struct { | |||||||
| 	{ "MAXSCALE_THREADS", VT_INT, (STATSFUNC)config_threadcount }, | 	{ "MAXSCALE_THREADS", VT_INT, (STATSFUNC)config_threadcount }, | ||||||
| 	{ "MAXSCALE_NBPOLLS", VT_INT, (STATSFUNC)config_nbpolls }, | 	{ "MAXSCALE_NBPOLLS", VT_INT, (STATSFUNC)config_nbpolls }, | ||||||
| 	{ "MAXSCALE_POLLSLEEP", VT_INT, (STATSFUNC)config_pollsleep }, | 	{ "MAXSCALE_POLLSLEEP", VT_INT, (STATSFUNC)config_pollsleep }, | ||||||
| 	{ "MAXSCALE_UPTIME", VT_INT, (STATSFUNC)MaxScaleUptime }, | 	{ "MAXSCALE_UPTIME", VT_INT, (STATSFUNC)maxscale_uptime }, | ||||||
| 	{ "MAXSCALE_SESSIONS", VT_INT, (STATSFUNC)serviceSessionCountAll }, | 	{ "MAXSCALE_SESSIONS", VT_INT, (STATSFUNC)serviceSessionCountAll }, | ||||||
| 	{ NULL, 0, 	NULL } | 	{ NULL, 0, 	NULL } | ||||||
| }; | }; | ||||||
| @ -1051,8 +1050,8 @@ static struct { | |||||||
| 	int		type; | 	int		type; | ||||||
| 	STATSFUNC	func; | 	STATSFUNC	func; | ||||||
| } status[] = { | } status[] = { | ||||||
| 	{ "Uptime", VT_INT, (STATSFUNC)MaxScaleUptime }, | 	{ "Uptime", VT_INT, (STATSFUNC)maxscale_uptime }, | ||||||
| 	{ "Uptime_since_flush_status", VT_INT, (STATSFUNC)MaxScaleUptime }, | 	{ "Uptime_since_flush_status", VT_INT, (STATSFUNC)maxscale_uptime }, | ||||||
| 	{ "Threads_created", VT_INT, (STATSFUNC)config_threadcount }, | 	{ "Threads_created", VT_INT, (STATSFUNC)config_threadcount }, | ||||||
| 	{ "Threads_running", VT_INT, (STATSFUNC)config_threadcount }, | 	{ "Threads_running", VT_INT, (STATSFUNC)config_threadcount }, | ||||||
| 	{ "Threadpool_threads", VT_INT, (STATSFUNC)config_threadcount }, | 	{ "Threadpool_threads", VT_INT, (STATSFUNC)config_threadcount }, | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Johan Wikman
					Johan Wikman