Skip to content

Commit

Permalink
Added status variable ProxySQL_Uptime #947
Browse files Browse the repository at this point in the history
  • Loading branch information
renecannao committed Mar 9, 2017
1 parent 9f4e5b1 commit d89e2a8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/MySQL_Thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit d89e2a8

Please sign in to comment.