MXS-224: Added SQL commands to the log message at slave disconnect time

MXS-224: Added SQL commands to the log message at slave disconnect time
This commit is contained in:
MassimilianoPinto
2015-08-19 11:58:42 +02:00
parent 4f568fce85
commit de902f316a
3 changed files with 6 additions and 2 deletions

View File

@ -233,6 +233,7 @@ typedef struct {
int n_bursts; /*< Number of bursts sent */
int n_requests; /*< Number of requests received */
int n_flows; /*< Number of flow control restarts */
int n_queries; /*< Number of SQL queries */
int n_upd;
int n_cb;
int n_cbna;

View File

@ -825,10 +825,12 @@ ROUTER_SLAVE *slave = (ROUTER_SLAVE *)router_session;
LOGIF(LM, (skygw_log_write_flush(
LOGFILE_MESSAGE,
"%s: Slave %s, server id %d, disconnected after %ld seconds. "
"%d events sent, %lu bytes.",
"%d SQL commands, %d events sent (%lu bytes).",
router->service->name, slave->dcb->remote,
slave->serverid,
time(0) - slave->connect_time, slave->stats.n_events,
time(0) - slave->connect_time,
slave->stats.n_queries,
slave->stats.n_events,
slave->stats.n_bytes)));
/*

View File

@ -157,6 +157,7 @@ blr_slave_request(ROUTER_INSTANCE *router, ROUTER_SLAVE *slave, GWBUF *queue)
switch (MYSQL_COMMAND(queue))
{
case COM_QUERY:
slave->stats.n_queries++;
return blr_slave_query(router, slave, queue);
break;
case COM_REGISTER_SLAVE: