Adding age of sessions and connections #2055

pull/2070/head
René Cannaò 7 years ago
parent a6897eaa0d
commit 9604e9fbfb

@ -2985,6 +2985,8 @@ SQLite3_result * MySQL_HostGroups_Manager::SQL3_Free_Connections() {
char buff[32];
sprintf(buff,"%p",conn);
j["address"] = buff;
uint64_t age_ms = (curtime - conn->creation_time)/1000;
j["age_ms"] = age_ms;
j["bytes_recv"] = conn->bytes_info.bytes_recv;
j["bytes_sent"] = conn->bytes_info.bytes_sent;
j["myconnpoll_get"] = conn->statuses.myconnpoll_get;

@ -707,6 +707,8 @@ void MySQL_Session::generate_proxysql_internal_session_json(json &j) {
char buff[32];
sprintf(buff,"%p",this);
j["address"] = buff;
uint64_t age_ms = (thread->curtime - start_time)/1000;
j["age_ms"] = age_ms;
j["autocommit"] = autocommit;
j["thread_session_id"] = thread_session_id;
j["current_hostgroup"] = current_hostgroup;

Loading…
Cancel
Save