From 2bc2ab2196e26627a5cdb23574a803d46ea55e93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 18 Feb 2020 09:23:13 +0200 Subject: [PATCH] MXS-2873: Document readwritesplit router diagnostics The REST API output is now documented in the router documentation. The same will be done for other routers as well. --- Documentation/Routers/ReadWriteSplit.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Documentation/Routers/ReadWriteSplit.md b/Documentation/Routers/ReadWriteSplit.md index 14c06f652..5300a6a46 100644 --- a/Documentation/Routers/ReadWriteSplit.md +++ b/Documentation/Routers/ReadWriteSplit.md @@ -661,6 +661,28 @@ initial connection creation is skipped. If the client executes only read queries, no connection to the master is made. If only write queries are made, only the master connection is used. +## Router Diagnostics + +The `router_diagnostics` field of the MaxCtrl `show service` and the service +REST API output for a readwritesplit service contains the following fields. + +* `queries`: Number of queries executed through this service. +* `route_master`: Number of writes routed to master. +* `route_slave`: Number of reads routed to slaves. +* `route_all`: Number of session commands routed to all servers. +* `rw_transactions`: Number of explicit read-write transactions. +* `ro_transactions`: Number of explicit read-only transactions. +* `replayed_transactions`: Number of replayed transactions. + +* `server_query_statistics`: Statistics for each configured and used server consisting of the following fields. + * `id`: Name of the server + * `total`: Total number of queries. + * `read`: Total number of reads. + * `write`: Total number of writes. + * `avg_sess_duration`: Average duration of a client session to this server. + * `avg_sess_active_pct`: Average percentage of time client sessions were active. 0% means connections were opened but never used. + * `avg_selects_per_session`: Average number of selects per session. + ## Server Ranks The general rule with server ranks is that primary servers will be used before