From 739fe7039caa23fbfabd2d7fb42dc791a3cbaa03 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Fri, 4 Mar 2016 11:47:12 +0200 Subject: [PATCH] Use new functions for accessing start- and uptime. --- server/modules/routing/maxinfo/maxinfo.c | 6 +++--- server/modules/routing/maxinfo/maxinfo_exec.c | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/server/modules/routing/maxinfo/maxinfo.c b/server/modules/routing/maxinfo/maxinfo.c index 797b47403..45e90382c 100644 --- a/server/modules/routing/maxinfo/maxinfo.c +++ b/server/modules/routing/maxinfo/maxinfo.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -430,11 +431,10 @@ maxinfo_statistics(INFO_INSTANCE *router, INFO_SESSION *session, GWBUF *queue) char result[1000], *ptr; GWBUF *ret; int len; -extern int MaxScaleUptime(); snprintf(result, 1000, "Uptime: %u Threads: %u Sessions: %u ", - MaxScaleUptime(), + maxscale_uptime(), config_threadcount(), serviceSessionCountAll()); if ((ret = gwbuf_alloc(4 + strlen(result))) == NULL) @@ -540,7 +540,7 @@ static char buf[40]; { (*context)++; row = resultset_make_row(result); - sprintf(buf, "%u", (unsigned int)MaxScaleStarted); + sprintf(buf, "%u", (unsigned int)maxscale_started()); resultset_row_set(row, 0, buf); return row; } diff --git a/server/modules/routing/maxinfo/maxinfo_exec.c b/server/modules/routing/maxinfo/maxinfo_exec.c index 658aa45b6..b1521c080 100644 --- a/server/modules/routing/maxinfo/maxinfo_exec.c +++ b/server/modules/routing/maxinfo/maxinfo_exec.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -776,8 +777,6 @@ getMaxScaleHome() #define VT_STRING 1 #define VT_INT 2 -extern int MaxScaleUptime(); - typedef void *(*STATSFUNC)(); /** * Variables that may be sent in a show variables @@ -794,7 +793,7 @@ static struct { { "MAXSCALE_THREADS", VT_INT, (STATSFUNC)config_threadcount }, { "MAXSCALE_NBPOLLS", VT_INT, (STATSFUNC)config_nbpolls }, { "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 }, { NULL, 0, NULL } }; @@ -1051,8 +1050,8 @@ static struct { int type; STATSFUNC func; } status[] = { - { "Uptime", VT_INT, (STATSFUNC)MaxScaleUptime }, - { "Uptime_since_flush_status", VT_INT, (STATSFUNC)MaxScaleUptime }, + { "Uptime", VT_INT, (STATSFUNC)maxscale_uptime }, + { "Uptime_since_flush_status", VT_INT, (STATSFUNC)maxscale_uptime }, { "Threads_created", VT_INT, (STATSFUNC)config_threadcount }, { "Threads_running", VT_INT, (STATSFUNC)config_threadcount }, { "Threadpool_threads", VT_INT, (STATSFUNC)config_threadcount },