|
|
|
|
@ -1677,6 +1677,8 @@ MySQL_Thread::MySQL_Thread() {
|
|
|
|
|
|
|
|
|
|
status_variables.queries=0;
|
|
|
|
|
status_variables.queries_slow=0;
|
|
|
|
|
status_variables.queries_backends_bytes_sent=0;
|
|
|
|
|
status_variables.queries_backends_bytes_recv=0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1787,6 +1789,18 @@ SQLite3_result * MySQL_Threads_Handler::SQL3_GlobalStatus() {
|
|
|
|
|
pta[1]=buf;
|
|
|
|
|
result->add_row(pta);
|
|
|
|
|
}
|
|
|
|
|
{ // Queries bytes recv
|
|
|
|
|
pta[0]=(char *)"Queries_backends_bytes_recv";
|
|
|
|
|
sprintf(buf,"%llu",get_queries_backends_bytes_recv());
|
|
|
|
|
pta[1]=buf;
|
|
|
|
|
result->add_row(pta);
|
|
|
|
|
}
|
|
|
|
|
{ // Queries bytes recv
|
|
|
|
|
pta[0]=(char *)"Queries_backends_bytes_sent";
|
|
|
|
|
sprintf(buf,"%llu",get_queries_backends_bytes_sent());
|
|
|
|
|
pta[1]=buf;
|
|
|
|
|
result->add_row(pta);
|
|
|
|
|
}
|
|
|
|
|
{ // Queries
|
|
|
|
|
pta[0]=(char *)"Questions";
|
|
|
|
|
sprintf(buf,"%llu",get_total_queries());
|
|
|
|
|
@ -2019,3 +2033,29 @@ unsigned long long MySQL_Threads_Handler::get_slow_queries() {
|
|
|
|
|
}
|
|
|
|
|
return q;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
unsigned long long MySQL_Threads_Handler::get_queries_backends_bytes_recv() {
|
|
|
|
|
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.queries_backends_bytes_recv,0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return q;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
unsigned long long MySQL_Threads_Handler::get_queries_backends_bytes_sent() {
|
|
|
|
|
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.queries_backends_bytes_sent,0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return q;
|
|
|
|
|
}
|
|
|
|
|
|