Added new metric 'proxysql_myhgm_auto_increment_multiplex_total' tracking the number of times that 'auto_increment_delay_multiplex' is triggered

pull/3330/head
Javier Jaramago Fernández 5 years ago
parent 6d49f5fa27
commit d507880cbb

@ -300,6 +300,7 @@ struct p_hg_counter {
myhgm_myconnpool_push,
myhgm_myconnpool_reset,
myhgm_myconnpool_destroy,
auto_increment_delay_multiplex,
__size
};
};
@ -458,6 +459,7 @@ class MySQL_HostGroups_Manager {
unsigned long long access_denied_max_connections;
unsigned long long access_denied_max_user_connections;
unsigned long long select_for_update_or_equivalent;
unsigned long long auto_increment_delay_multiplex;
//////////////////////////////////////////////////////
/// Prometheus Metrics ///

@ -1215,7 +1215,16 @@ hg_metrics_map = std::make_tuple(
"proxysql_myhgm_myconnpool_destroy_total",
"The number of connections considered unhealthy and therefore closed.",
metric_tags {}
)
),
// ====================================================================
std::make_tuple (
p_hg_counter::auto_increment_delay_multiplex,
"proxysql_myhgm_auto_increment_multiplex_total",
"The number of times that 'auto_increment_delay_multiplex' has been triggered.",
metric_tags {}
),
},
// prometheus gauges
hg_gauge_vector {
@ -4295,6 +4304,8 @@ void MySQL_HostGroups_Manager::p_update_metrics() {
p_update_counter(status.p_counter_array[p_hg_counter::myhgm_myconnpool_reset], status.myconnpoll_reset);
p_update_counter(status.p_counter_array[p_hg_counter::myhgm_myconnpool_destroy], status.myconnpoll_destroy);
p_update_counter(status.p_counter_array[p_hg_counter::auto_increment_delay_multiplex], status.auto_increment_delay_multiplex);
// Update the *connection_pool* metrics
this->p_update_connection_pool();
// Update the *gtid_executed* metrics

@ -4360,6 +4360,7 @@ handler_again:
last_HG_affected_rows = current_hostgroup;
if (mysql_thread___auto_increment_delay_multiplex && myconn->mysql->insert_id) {
myconn->auto_increment_delay_token = mysql_thread___auto_increment_delay_multiplex + 1;
__sync_fetch_and_add(&MyHGM->status.auto_increment_delay_multiplex, 1);
}
}
}

Loading…
Cancel
Save