Skip to content

Commit

Permalink
Merge pull request #4428 from sysown/v2.x-pause_status
Browse files Browse the repository at this point in the history
Added new status variable mysql_listener_paused
  • Loading branch information
renecannao authored Jan 19, 2024
2 parents acf2b7b + 5326298 commit 7d429c6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
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

0 comments on commit 7d429c6

Please sign in to comment.