Skip to content

Commit

Permalink
replication_group_id -> db_replication_id
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-holubicki committed Mar 20, 2024
1 parent 294c654 commit b567438
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion components/percona_telemetry/data_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions components/percona_telemetry/data_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <mysql/components/services/mysql_command_services.h>
#include <mysql/components/services/security_context.h>

//>> ugly part start
#ifdef RAPIDJSON_NO_SIZETYPEDEFINE
#include "my_rapidjson_size_t.h"
#endif
Expand All @@ -27,7 +26,6 @@ using RapidJsonWritterType = rapidjson::PrettyWriter<rapidjson::StringBuffer>;
#endif

#include <rapidjson/stringbuffer.h>
// ugly part end <<

using Row = std::vector<std::string>;
using QueryResult = std::vector<Row>;
Expand All @@ -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:
Expand All @@ -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_;
Expand Down
8 changes: 0 additions & 8 deletions components/percona_telemetry/worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit b567438

Please sign in to comment.