From d89e2a8430d95489dae051a1bb91235330334527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Thu, 9 Mar 2017 11:26:09 +0000 Subject: [PATCH] Added status variable ProxySQL_Uptime #947 --- lib/MySQL_Thread.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/MySQL_Thread.cpp b/lib/MySQL_Thread.cpp index 33f6af0d80..c9c192eaff 100644 --- a/lib/MySQL_Thread.cpp +++ b/lib/MySQL_Thread.cpp @@ -2970,6 +2970,13 @@ SQLite3_result * MySQL_Threads_Handler::SQL3_GlobalStatus() { result->add_column_definition(SQLITE_TEXT,"Variable_Name"); result->add_column_definition(SQLITE_TEXT,"Variable_Value"); // NOTE: as there is no string copy, we do NOT free pta[0] and pta[1] + { // uptime + unsigned long long t1=monotonic_time(); + pta[0] = (char *)"ProxySQL_Uptime"; + sprintf(buf,"%llu",(t1-GloVars.global.start_time)/1000/1000); + pta[1]=buf; + result->add_row(pta); + } { // Active Transactions pta[0]=(char *)"Active_Transactions"; sprintf(buf,"%u",get_active_transations());