From a37e1ad60f28a5d4adaef539f086ff2f15fb11ad Mon Sep 17 00:00:00 2001 From: Dhi Aurrahman Date: Tue, 22 Sep 2020 09:51:17 +0000 Subject: [PATCH] cleanup: Remove unused stats_prefix_ This removes unused stats_prefix_ variables. Signed-off-by: Dhi Aurrahman --- source/extensions/filters/network/mongo_proxy/proxy.cc | 7 +++---- source/extensions/filters/network/mongo_proxy/proxy.h | 1 - .../extensions/filters/network/mysql_proxy/mysql_filter.cc | 2 +- .../extensions/filters/network/mysql_proxy/mysql_filter.h | 1 - .../filters/network/postgres_proxy/postgres_filter.cc | 3 +-- .../filters/network/postgres_proxy/postgres_filter.h | 1 - 6 files changed, 5 insertions(+), 10 deletions(-) diff --git a/source/extensions/filters/network/mongo_proxy/proxy.cc b/source/extensions/filters/network/mongo_proxy/proxy.cc index fa70d4ae9801..b8ee760c910b 100644 --- a/source/extensions/filters/network/mongo_proxy/proxy.cc +++ b/source/extensions/filters/network/mongo_proxy/proxy.cc @@ -59,10 +59,9 @@ ProxyFilter::ProxyFilter(const std::string& stat_prefix, Stats::Scope& scope, const Filters::Common::Fault::FaultDelayConfigSharedPtr& fault_config, const Network::DrainDecision& drain_decision, TimeSource& time_source, bool emit_dynamic_metadata, const MongoStatsSharedPtr& mongo_stats) - : stat_prefix_(stat_prefix), stats_(generateStats(stat_prefix, scope)), runtime_(runtime), - drain_decision_(drain_decision), access_log_(access_log), fault_config_(fault_config), - time_source_(time_source), emit_dynamic_metadata_(emit_dynamic_metadata), - mongo_stats_(mongo_stats) { + : stats_(generateStats(stat_prefix, scope)), runtime_(runtime), drain_decision_(drain_decision), + access_log_(access_log), fault_config_(fault_config), time_source_(time_source), + emit_dynamic_metadata_(emit_dynamic_metadata), mongo_stats_(mongo_stats) { if (!runtime_.snapshot().featureEnabled(MongoRuntimeConfig::get().ConnectionLoggingEnabled, 100)) { // If we are not logging at the connection level, just release the shared pointer so that we diff --git a/source/extensions/filters/network/mongo_proxy/proxy.h b/source/extensions/filters/network/mongo_proxy/proxy.h index c54308f1ae38..773d4714aa7f 100644 --- a/source/extensions/filters/network/mongo_proxy/proxy.h +++ b/source/extensions/filters/network/mongo_proxy/proxy.h @@ -183,7 +183,6 @@ class ProxyFilter : public Network::Filter, void tryInjectDelay(); std::unique_ptr decoder_; - std::string stat_prefix_; MongoProxyStats stats_; Runtime::Loader& runtime_; const Network::DrainDecision& drain_decision_; diff --git a/source/extensions/filters/network/mysql_proxy/mysql_filter.cc b/source/extensions/filters/network/mysql_proxy/mysql_filter.cc index e66701ee8784..d3fa62e55fc8 100644 --- a/source/extensions/filters/network/mysql_proxy/mysql_filter.cc +++ b/source/extensions/filters/network/mysql_proxy/mysql_filter.cc @@ -14,7 +14,7 @@ namespace NetworkFilters { namespace MySQLProxy { MySQLFilterConfig::MySQLFilterConfig(const std::string& stat_prefix, Stats::Scope& scope) - : scope_(scope), stat_prefix_(stat_prefix), stats_(generateStats(stat_prefix, scope)) {} + : scope_(scope), stats_(generateStats(stat_prefix, scope)) {} MySQLFilter::MySQLFilter(MySQLFilterConfigSharedPtr config) : config_(std::move(config)) {} diff --git a/source/extensions/filters/network/mysql_proxy/mysql_filter.h b/source/extensions/filters/network/mysql_proxy/mysql_filter.h index 2d73ef9b5846..daabb165dde6 100644 --- a/source/extensions/filters/network/mysql_proxy/mysql_filter.h +++ b/source/extensions/filters/network/mysql_proxy/mysql_filter.h @@ -54,7 +54,6 @@ class MySQLFilterConfig { const MySQLProxyStats& stats() { return stats_; } Stats::Scope& scope_; - const std::string stat_prefix_; MySQLProxyStats stats_; private: diff --git a/source/extensions/filters/network/postgres_proxy/postgres_filter.cc b/source/extensions/filters/network/postgres_proxy/postgres_filter.cc index f66754c05101..ee8526b92c9f 100644 --- a/source/extensions/filters/network/postgres_proxy/postgres_filter.cc +++ b/source/extensions/filters/network/postgres_proxy/postgres_filter.cc @@ -13,8 +13,7 @@ namespace PostgresProxy { PostgresFilterConfig::PostgresFilterConfig(const std::string& stat_prefix, bool enable_sql_parsing, Stats::Scope& scope) - : stat_prefix_{stat_prefix}, - enable_sql_parsing_(enable_sql_parsing), scope_{scope}, stats_{generateStats(stat_prefix, + : enable_sql_parsing_(enable_sql_parsing), scope_{scope}, stats_{generateStats(stat_prefix, scope)} {} PostgresFilter::PostgresFilter(PostgresFilterConfigSharedPtr config) : config_{config} { diff --git a/source/extensions/filters/network/postgres_proxy/postgres_filter.h b/source/extensions/filters/network/postgres_proxy/postgres_filter.h index 5571a0587c40..f3ef83a6abce 100644 --- a/source/extensions/filters/network/postgres_proxy/postgres_filter.h +++ b/source/extensions/filters/network/postgres_proxy/postgres_filter.h @@ -65,7 +65,6 @@ class PostgresFilterConfig { PostgresFilterConfig(const std::string& stat_prefix, bool enable_sql_parsing, Stats::Scope& scope); - const std::string stat_prefix_; bool enable_sql_parsing_{true}; Stats::Scope& scope_; PostgresProxyStats stats_;