MXS-2078 Take new statistics into use

This commit is contained in:
Niclas Antti
2018-11-05 16:15:16 +02:00
parent 5175d2b2d7
commit c692c864e2
7 changed files with 55 additions and 31 deletions

View File

@ -36,6 +36,7 @@
#include <maxscale/protocol/mysql.h>
#include <maxscale/routingworker.hh>
#include <maxscale/protocol/rwbackend.hh>
#include <maxscale/session_stats.hh>
enum backend_type_t
{
@ -241,20 +242,8 @@ struct Stats
uint64_t n_rw_trx = 0; /**< Read-write transaction count */
};
// Statistics for one server
struct ServerStats
{
uint64_t total = 0; // Sum of master + slave + all
uint64_t read = 0; // Write queries
uint64_t write = 0; // Read queries
void operator+=(const ServerStats& rhs)
{
total += rhs.total;
read += rhs.read;
write += rhs.write;
}
};
using maxscale::ServerStats;
using maxscale::SrvStatMap;
class RWSplitSession;
@ -268,8 +257,6 @@ class RWSplit : public mxs::Router<RWSplit, RWSplitSession>
public:
using SrvStatMap = std::map<SERVER*, ServerStats>;
RWSplit(SERVICE* service, const Config& config);
~RWSplit();