MXS-1507: Add transaction replay statistics
Added a simple counter for the number of replayed transactions.
This commit is contained in:
@ -370,6 +370,8 @@ void RWSplit::diagnostics(DCB *dcb)
|
||||
stats().n_slave, slave_pct);
|
||||
dcb_printf(dcb, "\tNumber of queries forwarded to all: %" PRIu64 " (%.2f%%)\n",
|
||||
stats().n_all, all_pct);
|
||||
dcb_printf(dcb, "\tNumber of replayed transactions: %" PRIu64 "\n",
|
||||
stats().n_trx_replay);
|
||||
|
||||
if (*weightby)
|
||||
{
|
||||
@ -399,6 +401,7 @@ json_t* RWSplit::diagnostics_json() const
|
||||
json_object_set_new(rval, "route_master", json_integer(stats().n_master));
|
||||
json_object_set_new(rval, "route_slave", json_integer(stats().n_slave));
|
||||
json_object_set_new(rval, "route_all", json_integer(stats().n_all));
|
||||
json_object_set_new(rval, "replayed_transactions", json_integer(stats().n_trx_replay));
|
||||
|
||||
const char *weightby = serviceGetWeightingParameter(service());
|
||||
|
||||
|
@ -211,7 +211,8 @@ public:
|
||||
n_queries(0),
|
||||
n_master(0),
|
||||
n_slave(0),
|
||||
n_all(0)
|
||||
n_all(0),
|
||||
n_trx_replay(0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -220,6 +221,7 @@ public:
|
||||
uint64_t n_master; /**< Number of stmts sent to master */
|
||||
uint64_t n_slave; /**< Number of stmts sent to slave */
|
||||
uint64_t n_all; /**< Number of stmts sent to all */
|
||||
uint64_t n_trx_replay; /**< Number of replayed transactions */
|
||||
};
|
||||
|
||||
class RWSplitSession;
|
||||
|
@ -380,6 +380,7 @@ void RWSplitSession::handle_trx_replay()
|
||||
{
|
||||
// No more statements to execute
|
||||
m_is_replay_active = false;
|
||||
atomic_add_uint64(&m_router->stats().n_trx_replay, 1);
|
||||
|
||||
// Check that the checksums match.
|
||||
SHA1Checksum chksum = m_trx.checksum();
|
||||
|
Reference in New Issue
Block a user