Skip to content

Commit

Permalink
cleanup: Remove unused stats_prefix_ (envoyproxy#13214)
Browse files Browse the repository at this point in the history
This removes unused stats_prefix_ variables.

Signed-off-by: Dhi Aurrahman <[email protected]>
  • Loading branch information
dio authored Sep 22, 2020
1 parent 1a54bbb commit ba54dbd
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 10 deletions.
7 changes: 3 additions & 4 deletions source/extensions/filters/network/mongo_proxy/proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion source/extensions/filters/network/mongo_proxy/proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ class ProxyFilter : public Network::Filter,
void tryInjectDelay();

std::unique_ptr<Decoder> decoder_;
std::string stat_prefix_;
MongoProxyStats stats_;
Runtime::Loader& runtime_;
const Network::DrainDecision& drain_decision_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class MySQLFilterConfig {
const MySQLProxyStats& stats() { return stats_; }

Stats::Scope& scope_;
const std::string stat_prefix_;
MySQLProxyStats stats_;

private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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} {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down

0 comments on commit ba54dbd

Please sign in to comment.