MXS-3609: Use 64-bit integers for statistics
This should be enough to avoid the problem of integer overflow in 2.4.
This commit is contained in:
@ -51,7 +51,7 @@ struct Config
|
||||
bool debug; /**< Enable verbose debug messages to clients */
|
||||
pcre2_code* ignore_regex; /**< Regular expression used to ignore tables */
|
||||
pcre2_match_data* ignore_match_data;/**< Match data for @c ignore_regex */
|
||||
std::set<std::string> ignored_tables; /**< Set of ignored tables */
|
||||
std::set<std::string> ignored_tables; /**< Set of ignored tables */
|
||||
SERVER* preferred_server; /**< Server to prefer in conflict situations */
|
||||
|
||||
Config(MXS_CONFIG_PARAMETER* conf);
|
||||
@ -70,17 +70,17 @@ typedef std::shared_ptr<Config> SConfig;
|
||||
*/
|
||||
struct Stats
|
||||
{
|
||||
int n_queries; /*< Number of queries forwarded */
|
||||
int n_sescmd; /*< Number of session commands */
|
||||
int longest_sescmd; /*< Longest chain of stored session commands */
|
||||
int n_hist_exceeded; /*< Number of sessions that exceeded session
|
||||
* command history limit */
|
||||
int sessions; /*< Number of sessions */
|
||||
int shmap_cache_hit; /*< Shard map was found from the cache */
|
||||
int shmap_cache_miss;/*< No shard map found from the cache */
|
||||
double ses_longest; /*< Longest session */
|
||||
double ses_shortest; /*< Shortest session */
|
||||
double ses_average; /*< Average session length */
|
||||
uint64_t n_queries; /*< Number of queries forwarded */
|
||||
uint64_t n_sescmd; /*< Number of session commands */
|
||||
uint64_t longest_sescmd; /*< Longest chain of stored session commands */
|
||||
uint64_t n_hist_exceeded; /*< Number of sessions that exceeded session
|
||||
* command history limit */
|
||||
uint64_t sessions; /*< Number of sessions */
|
||||
uint64_t shmap_cache_hit; /*< Shard map was found from the cache */
|
||||
uint64_t shmap_cache_miss; /*< No shard map found from the cache */
|
||||
double ses_longest; /*< Longest session */
|
||||
double ses_shortest; /*< Shortest session */
|
||||
double ses_average; /*< Average session length */
|
||||
|
||||
Stats()
|
||||
: n_queries(0)
|
||||
|
||||
@ -212,16 +212,16 @@ void SchemaRouter::diagnostics(DCB* dcb)
|
||||
/** Session command statistics */
|
||||
dcb_printf(dcb, "\n\33[1;4mSession Commands\33[0m\n");
|
||||
dcb_printf(dcb,
|
||||
"Total number of queries: %d\n",
|
||||
"Total number of queries: %lu\n",
|
||||
m_stats.n_queries);
|
||||
dcb_printf(dcb,
|
||||
"Percentage of session commands: %.2f\n",
|
||||
sescmd_pct);
|
||||
dcb_printf(dcb,
|
||||
"Longest chain of stored session commands: %d\n",
|
||||
"Longest chain of stored session commands: %lu\n",
|
||||
m_stats.longest_sescmd);
|
||||
dcb_printf(dcb,
|
||||
"Session command history limit exceeded: %d times\n",
|
||||
"Session command history limit exceeded: %lu times\n",
|
||||
m_stats.n_hist_exceeded);
|
||||
|
||||
/** Session time statistics */
|
||||
@ -233,8 +233,8 @@ void SchemaRouter::diagnostics(DCB* dcb)
|
||||
dcb_printf(dcb, "Shortest session: %.2lf seconds\n", m_stats.ses_shortest);
|
||||
dcb_printf(dcb, "Average session length: %.2lf seconds\n", m_stats.ses_average);
|
||||
}
|
||||
dcb_printf(dcb, "Shard map cache hits: %d\n", m_stats.shmap_cache_hit);
|
||||
dcb_printf(dcb, "Shard map cache misses: %d\n", m_stats.shmap_cache_miss);
|
||||
dcb_printf(dcb, "Shard map cache hits: %lu\n", m_stats.shmap_cache_hit);
|
||||
dcb_printf(dcb, "Shard map cache misses: %lu\n", m_stats.shmap_cache_miss);
|
||||
dcb_printf(dcb, "\n");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user