From b567438190b3f04147e8e9fa0e8a4d0f9d3c9cff Mon Sep 17 00:00:00 2001 From: Kamil Holubicki Date: Wed, 20 Mar 2024 10:06:10 +0100 Subject: [PATCH] replication_group_id -> db_replication_id --- components/percona_telemetry/data_provider.cc | 2 +- components/percona_telemetry/data_provider.h | 5 ++--- components/percona_telemetry/worker.cc | 8 -------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/components/percona_telemetry/data_provider.cc b/components/percona_telemetry/data_provider.cc index f902a9ee32f3..b02868ebd99d 100644 --- a/components/percona_telemetry/data_provider.cc +++ b/components/percona_telemetry/data_provider.cc @@ -351,7 +351,7 @@ bool DataProvider::collect_group_replication_info( rapidjson::Value replication_group_id; replication_group_id.SetString(result[0][1].c_str(), allocator); - gr_json.AddMember(rapidjson::StringRef("replication_group_id"), + gr_json.AddMember(rapidjson::StringRef("db_replication_id"), replication_group_id, allocator); rapidjson::Value single_primary_mode; diff --git a/components/percona_telemetry/data_provider.h b/components/percona_telemetry/data_provider.h index 71b4883f5a3a..c70de48d86b1 100644 --- a/components/percona_telemetry/data_provider.h +++ b/components/percona_telemetry/data_provider.h @@ -10,7 +10,6 @@ #include #include -//>> ugly part start #ifdef RAPIDJSON_NO_SIZETYPEDEFINE #include "my_rapidjson_size_t.h" #endif @@ -27,7 +26,6 @@ using RapidJsonWritterType = rapidjson::PrettyWriter; #endif #include -// ugly part end << using Row = std::vector; using QueryResult = std::vector; @@ -54,7 +52,6 @@ class DataProvider { void thread_access_begin(); void thread_access_end(); - const std::string &get_database_instance_id(); std::string get_report(); private: @@ -73,6 +70,8 @@ class DataProvider { bool collect_async_replication_info(rapidjson::Document *document); bool collect_metrics(rapidjson::Document *document); + const std::string &get_database_instance_id(); + SERVICE_TYPE(mysql_command_factory) & command_factory_service_; SERVICE_TYPE(mysql_command_options) & command_options_service_; SERVICE_TYPE(mysql_command_query) & command_query_service_; diff --git a/components/percona_telemetry/worker.cc b/components/percona_telemetry/worker.cc index 09afaef7d668..2b4756d94917 100644 --- a/components/percona_telemetry/worker.cc +++ b/components/percona_telemetry/worker.cc @@ -50,14 +50,6 @@ void Worker::worker_thd_fn() { // The server is probably still initializing if the grace period is low, so // we need to wait up to the point when database connection can be done - // We do it only once, as it is constant - std::string db_id = data_provider_.get_database_instance_id(); - - if (!db_id.length()) { - logger_.warning("get_database_instance_id() failed"); - // and what now? fallback or game over? - } - logger_.info("Scrape interval: %d seconds", config_.scrape_interval()); logger_.info("History keep interval: %d seconds", config_.history_keep_interval());