Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new status variable mysql_listener_paused #4428

Merged
merged 1 commit into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/proxysql_admin.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ struct p_admin_gauge {
stmt_cached,
fds_in_use,
version_info,
mysql_listener_paused,
__size
};
};
Expand Down
20 changes: 19 additions & 1 deletion lib/ProxySQL_Admin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,12 @@ admin_metrics_map = std::make_tuple(
)
},
admin_gauge_vector {
std::make_tuple (
p_admin_gauge::mysql_listener_paused,
"proxysql_mysql_listener_paused",
"MySQL listener paused because of PROXYSQL PAUSE.",
metric_tags {}
),
// memory metrics
std::make_tuple (
p_admin_gauge::connpool_memory_bytes,
Expand Down Expand Up @@ -9421,6 +9427,11 @@ void ProxySQL_Admin::p_update_metrics() {
this->p_stats___memory_metrics();
// Update stmt metrics
this->p_update_stmt_metrics();

// updated mysql_listener_paused
int st = ( proxysql_mysql_paused == true ? 1 : 0);
this->metrics.p_gauge_array[p_admin_gauge::mysql_listener_paused]->Set(st);

}

/**
Expand Down Expand Up @@ -9915,7 +9926,14 @@ void ProxySQL_Admin::stats___mysql_global() {
statsdb->execute(query);
free(query);
}

{
vn=(char *)"mysql_listener_paused";
sprintf(bu, "%s", ( proxysql_mysql_paused==true ? "true" : "false") );
query=(char *)malloc(strlen(a)+strlen(vn)+strlen(bu)+16);
sprintf(query,a,vn,bu);
statsdb->execute(query);
free(query);
}
statsdb->execute("COMMIT");
}

Expand Down
Loading