|
|
|
|
@ -3677,6 +3677,10 @@ MySQL_Thread::MySQL_Thread() {
|
|
|
|
|
status_variables.gtid_session_collected = 0;
|
|
|
|
|
status_variables.generated_pkt_err = 0;
|
|
|
|
|
status_variables.max_connect_timeout_err = 0;
|
|
|
|
|
status_variables.unexpected_com_quit = 0;
|
|
|
|
|
status_variables.unexpected_packet = 0;
|
|
|
|
|
status_variables.killed_connections = 0;
|
|
|
|
|
status_variables.killed_queries = 0;
|
|
|
|
|
|
|
|
|
|
match_regexes=NULL;
|
|
|
|
|
|
|
|
|
|
@ -4155,6 +4159,30 @@ SQLite3_result * MySQL_Threads_Handler::SQL3_GlobalStatus(bool _memory) {
|
|
|
|
|
pta[1]=buf;
|
|
|
|
|
result->add_row(pta);
|
|
|
|
|
}
|
|
|
|
|
{ // Unexpected COM_QUIT
|
|
|
|
|
pta[0]=(char *)"mysql_unexpected_frontend_com_quit";
|
|
|
|
|
sprintf(buf,"%llu",get_unexpected_com_quit());
|
|
|
|
|
pta[1]=buf;
|
|
|
|
|
result->add_row(pta);
|
|
|
|
|
}
|
|
|
|
|
{ // Unexpected packet
|
|
|
|
|
pta[0]=(char *)"mysql_unexpected_frontend_packets";
|
|
|
|
|
sprintf(buf,"%llu",get_unexpected_packet());
|
|
|
|
|
pta[1]=buf;
|
|
|
|
|
result->add_row(pta);
|
|
|
|
|
}
|
|
|
|
|
{ // killed connections
|
|
|
|
|
pta[0]=(char *)"mysql_killed_backend_connections";
|
|
|
|
|
sprintf(buf,"%llu",get_killed_connections());
|
|
|
|
|
pta[1]=buf;
|
|
|
|
|
result->add_row(pta);
|
|
|
|
|
}
|
|
|
|
|
{ // killed queries
|
|
|
|
|
pta[0]=(char *)"mysql_killed_backend_queries";
|
|
|
|
|
sprintf(buf,"%llu",get_killed_queries());
|
|
|
|
|
pta[1]=buf;
|
|
|
|
|
result->add_row(pta);
|
|
|
|
|
}
|
|
|
|
|
free(pta);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
@ -5100,3 +5128,55 @@ unsigned long long MySQL_Threads_Handler::get_max_connect_timeout() {
|
|
|
|
|
}
|
|
|
|
|
return q;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
unsigned long long MySQL_Threads_Handler::get_unexpected_com_quit() {
|
|
|
|
|
unsigned long long q=0;
|
|
|
|
|
unsigned int i;
|
|
|
|
|
for (i=0;i<num_threads;i++) {
|
|
|
|
|
if (mysql_threads) {
|
|
|
|
|
MySQL_Thread *thr=(MySQL_Thread *)mysql_threads[i].worker;
|
|
|
|
|
if (thr)
|
|
|
|
|
q+=__sync_fetch_and_add(&thr->status_variables.unexpected_com_quit,0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return q;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
unsigned long long MySQL_Threads_Handler::get_unexpected_packet() {
|
|
|
|
|
unsigned long long q=0;
|
|
|
|
|
unsigned int i;
|
|
|
|
|
for (i=0;i<num_threads;i++) {
|
|
|
|
|
if (mysql_threads) {
|
|
|
|
|
MySQL_Thread *thr=(MySQL_Thread *)mysql_threads[i].worker;
|
|
|
|
|
if (thr)
|
|
|
|
|
q+=__sync_fetch_and_add(&thr->status_variables.unexpected_packet,0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return q;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
unsigned long long MySQL_Threads_Handler::get_killed_connections() {
|
|
|
|
|
unsigned long long q=0;
|
|
|
|
|
unsigned int i;
|
|
|
|
|
for (i=0;i<num_threads;i++) {
|
|
|
|
|
if (mysql_threads) {
|
|
|
|
|
MySQL_Thread *thr=(MySQL_Thread *)mysql_threads[i].worker;
|
|
|
|
|
if (thr)
|
|
|
|
|
q+=__sync_fetch_and_add(&thr->status_variables.killed_connections,0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return q;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
unsigned long long MySQL_Threads_Handler::get_killed_queries() {
|
|
|
|
|
unsigned long long q=0;
|
|
|
|
|
unsigned int i;
|
|
|
|
|
for (i=0;i<num_threads;i++) {
|
|
|
|
|
if (mysql_threads) {
|
|
|
|
|
MySQL_Thread *thr=(MySQL_Thread *)mysql_threads[i].worker;
|
|
|
|
|
if (thr)
|
|
|
|
|
q+=__sync_fetch_and_add(&thr->status_variables.killed_queries,0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return q;
|
|
|
|
|
}
|
|
|
|
|
|