Added server state information to trace log printing

This commit is contained in:
VilhoRaatikka
2014-10-17 09:44:52 +03:00
parent 0633dc568c
commit 6041a7e12f

View File

@ -2696,34 +2696,38 @@ static bool select_connect_backend_servers(
switch(select_criteria) { switch(select_criteria) {
case LEAST_GLOBAL_CONNECTIONS: case LEAST_GLOBAL_CONNECTIONS:
LOGIF(LT, (skygw_log_write_flush(LOGFILE_TRACE, LOGIF(LT, (skygw_log_write_flush(LOGFILE_TRACE,
"%s:%d MaxScale connections : %d", "MaxScale connections : %d in \t%s:%d %s",
b->backend_server->name, b->backend_server->stats.n_current,
b->backend_server->port, b->backend_server->name,
b->backend_server->stats.n_current))); b->backend_server->port,
STRSRVSTATUS(b->backend_server))));
break; break;
case LEAST_ROUTER_CONNECTIONS: case LEAST_ROUTER_CONNECTIONS:
LOGIF(LT, (skygw_log_write_flush(LOGFILE_TRACE, LOGIF(LT, (skygw_log_write_flush(LOGFILE_TRACE,
"%s:%d RWSplit connections : %d", "RWSplit connections : %d in \t%s:%d %s",
b->backend_server->name, b->backend_conn_count,
b->backend_server->port, b->backend_server->name,
b->backend_conn_count))); b->backend_server->port,
STRSRVSTATUS(b->backend_server))));
break; break;
case LEAST_CURRENT_OPERATIONS: case LEAST_CURRENT_OPERATIONS:
LOGIF(LT, (skygw_log_write_flush(LOGFILE_TRACE, LOGIF(LT, (skygw_log_write_flush(LOGFILE_TRACE,
"%s:%d current operations : %d", "current operations : %d in \t%s:%d %s",
b->backend_server->name, b->backend_server->stats.n_current_ops,
b->backend_server->port, b->backend_server->name,
b->backend_server->stats.n_current_ops))); b->backend_server->port,
STRSRVSTATUS(b->backend_server))));
break; break;
case LEAST_BEHIND_MASTER: case LEAST_BEHIND_MASTER:
LOGIF(LT, (skygw_log_write_flush(LOGFILE_TRACE, LOGIF(LT, (skygw_log_write_flush(LOGFILE_TRACE,
"%s:%d replication lag : %d", "replication lag : %d in \t%s:%d %s",
b->backend_server->name, b->backend_server->rlag,
b->backend_server->port, b->backend_server->name,
b->backend_server->rlag))); b->backend_server->port,
STRSRVSTATUS(b->backend_server))));
default: default:
break; break;
} }