Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
MassimilianoPinto committed Aug 19, 2015
1 parent 3f26c30 commit 8959894
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions server/modules/include/blr.h
Expand Up @@ -207,6 +207,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;
Expand Down
6 changes: 4 additions & 2 deletions server/modules/routing/binlog/blr.c
Expand Up @@ -640,10 +640,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)));

/*
Expand Down
1 change: 1 addition & 0 deletions server/modules/routing/binlog/blr_slave.c
Expand Up @@ -122,6 +122,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:
Expand Down

0 comments on commit 8959894

Please sign in to comment.