@ -613,6 +613,7 @@ static char * admin_variables_names[]= {
( char * ) " stats_mysql_connection_pool " ,
( char * ) " stats_mysql_query_cache " ,
( char * ) " stats_mysql_query_digest_to_disk " ,
( char * ) " stats_mysql_eventslog_sync_buffer_to_disk " ,
( char * ) " stats_system_cpu " ,
( char * ) " stats_system_memory " ,
( char * ) " mysql_ifaces " ,
@ -5838,6 +5839,14 @@ __end_while_pool:
curtime2 = curtime2 / 1000 ;
proxy_info ( " Automatically saved stats_mysql_query_digest to disk: %llums to write %d entries \n " , curtime2 - curtime1 , r1 ) ;
}
if ( GloProxyStats - > MySQL_Logger_dump_eventslog_timetoget ( curtime ) ) {
unsigned long long curtime1 = monotonic_time ( ) ;
int r1 = GloMyLogger - > processEvents ( nullptr , SPA - > statsdb_disk ) ;
unsigned long long curtime2 = monotonic_time ( ) ;
curtime1 = curtime1 / 1000 ;
curtime2 = curtime2 / 1000 ;
proxy_info ( " Automatically saved history_mysql_query_events to disk: %llums to write %d entries \n " , curtime2 - curtime1 , r1 ) ;
}
if ( GloProxyStats - > system_cpu_timetoget ( curtime ) ) {
GloProxyStats - > system_cpu_sets ( ) ;
}
@ -6054,12 +6063,14 @@ ProxySQL_Admin::ProxySQL_Admin() :
variables . stats_mysql_connections = 60 ;
variables . stats_mysql_query_cache = 60 ;
variables . stats_mysql_query_digest_to_disk = 0 ;
variables . stats_mysql_eventslog_sync_buffer_to_disk = 0 ;
variables . stats_system_cpu = 60 ;
variables . stats_system_memory = 60 ;
GloProxyStats - > variables . stats_mysql_connection_pool = 60 ;
GloProxyStats - > variables . stats_mysql_connections = 60 ;
GloProxyStats - > variables . stats_mysql_query_cache = 60 ;
GloProxyStats - > variables . stats_mysql_query_digest_to_disk = 0 ;
GloProxyStats - > variables . stats_mysql_eventslog_sync_buffer_to_disk = 0 ;
GloProxyStats - > variables . stats_system_cpu = 60 ;
# ifndef NOJEM
GloProxyStats - > variables . stats_system_memory = 60 ;
@ -8457,6 +8468,10 @@ char * ProxySQL_Admin::get_variable(char *name) {
sprintf ( intbuf , " %d " , variables . stats_mysql_query_digest_to_disk ) ;
return strdup ( intbuf ) ;
}
if ( ! strcasecmp ( name , " stats_mysql_eventslog_sync_buffer_to_disk " ) ) {
sprintf ( intbuf , " %d " , variables . stats_mysql_eventslog_sync_buffer_to_disk ) ;
return strdup ( intbuf ) ;
}
if ( ! strcasecmp ( name , " stats_system_cpu " ) ) {
sprintf ( intbuf , " %d " , variables . stats_system_cpu ) ;
return strdup ( intbuf ) ;
@ -8762,6 +8777,16 @@ bool ProxySQL_Admin::set_variable(char *name, char *value, bool lock) { // this
return false ;
}
}
if ( ! strcasecmp ( name , " stats_mysql_eventslog_sync_buffer_to_disk " ) ) {
int intv = atoi ( value ) ;
if ( intv > = 0 & & intv < = 24 * 3600 ) {
variables . stats_mysql_eventslog_sync_buffer_to_disk = intv ;
GloProxyStats - > variables . stats_mysql_eventslog_sync_buffer_to_disk = intv ;
return true ;
} else {
return false ;
}
}
if ( ! strcasecmp ( name , " stats_system_cpu " ) ) {
int intv = atoi ( value ) ;
if ( intv > = 0 & & intv < = 600 ) {