Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stats: Add option to switch between fake and real symbol-tables on the command-line. #7882

Merged
merged 21 commits into from
Aug 21, 2019
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d4744bd
Add option to switch between fake and real symbol-tables on the comma…
jmarantz Aug 8, 2019
313d591
Add command-line option to switch between real/fake symbol tables, an…
jmarantz Aug 9, 2019
bee7b67
Merge branch 'master' into symbol-table-option
jmarantz Aug 9, 2019
56ab602
use configured symbol-table impl in integration tests.
jmarantz Aug 9, 2019
a0e1d7c
clang-tidy error
jmarantz Aug 9, 2019
92442ef
Cover both real & fake symbol tables in symbol-table memory test.
jmarantz Aug 10, 2019
96f4e85
cleanups
jmarantz Aug 10, 2019
f9c4f82
Merge branch 'master' into symbol-table-option
jmarantz Aug 10, 2019
08f444e
convert more tests to use the symbol-table creator rather than hard-c…
jmarantz Aug 10, 2019
5021cc2
format
jmarantz Aug 10, 2019
6ce2eec
fix typo
jmarantz Aug 10, 2019
0605670
attempt to avoid possible coverage-test issue by removing a possibly …
jmarantz Aug 11, 2019
a8860bb
try commenting out sim-time to see if it fixes integration-admin-test.
jmarantz Aug 11, 2019
9266115
Comment.
jmarantz Aug 11, 2019
8d3cb07
Add setter for fake-symbol-tables.
jmarantz Aug 16, 2019
a4cee7b
fix typo
jmarantz Aug 16, 2019
d1eced2
Merge branch 'master' into symbol-table-option
jmarantz Aug 18, 2019
2ae8431
Adjust memory expectation post master-merge.
jmarantz Aug 18, 2019
753aff4
Merge branch 'master' into symbol-table-option
jmarantz Aug 19, 2019
6d2a2ac
Avoid multiple distinct symbol-table types with makeSymbolTable() cal…
jmarantz Aug 21, 2019
bf55388
Merge branch 'master' into symbol-table-option
jmarantz Aug 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/root/intro/version_history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Version history
* http: added the ability to :ref:`merge adjacent slashes<envoy_api_field_config.filter.network.http_connection_manager.v2.HttpConnectionManager.merge_slashes>` in the path.
* listeners: added :ref:`continue_on_listener_filters_timeout <envoy_api_field_Listener.continue_on_listener_filters_timeout>` to configure whether a listener will still create a connection when listener filters time out.
* listeners: added :ref:`HTTP inspector listener filter <config_listener_filters_http_inspector>`.
* performance: stats symbol table implementation (disabled by default; to test it, add "--use-fake-symbol-table 0" to the command-line arguments when starting Envoy).
* redis: added :ref:`read_policy <envoy_api_field_config.filter.network.redis_proxy.v2.RedisProxy.ConnPoolSettings.read_policy>` to allow reading from redis replicas for Redis Cluster deployments.
* rbac: added support for DNS SAN as :ref:`principal_name <envoy_api_field_config.rbac.v2.Principal.Authenticated.principal_name>`.
* lua: extended `httpCall()` and `respond()` APIs to accept headers with entry values that can be a string or table of strings.
Expand Down
5 changes: 5 additions & 0 deletions include/envoy/server/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ class Options {
*/
virtual bool libeventBufferEnabled() const PURE;

/**
* @return whether to use the fake symbol table implementation.
*/
virtual bool fakeSymbolTableEnabled() const PURE;

/**
* @return bool indicating whether cpuset size should determine the number of worker threads.
*/
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/stats/symbol_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class SymbolTable {
virtual StoragePtr encode(absl::string_view name) PURE;
};

using SharedSymbolTable = std::shared_ptr<SymbolTable>;
using SymbolTablePtr = std::unique_ptr<SymbolTable>;

} // namespace Stats
} // namespace Envoy
12 changes: 12 additions & 0 deletions source/common/stats/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ envoy_cc_library(
":scope_prefixer_lib",
":stats_lib",
":store_impl_lib",
":symbol_table_creator_lib",
"//include/envoy/stats:stats_macros",
"//source/common/stats:allocator_lib",
],
Expand Down Expand Up @@ -155,6 +156,17 @@ envoy_cc_library(
],
)

envoy_cc_library(
name = "symbol_table_creator_lib",
srcs = ["symbol_table_creator.cc"],
hdrs = ["symbol_table_creator.h"],
external_deps = ["abseil_base"],
deps = [
":fake_symbol_table_lib",
":symbol_table_lib",
],
)

envoy_cc_library(
name = "fake_symbol_table_lib",
hdrs = ["fake_symbol_table_impl.h"],
Expand Down
4 changes: 2 additions & 2 deletions source/common/stats/isolated_store_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
#include "common/stats/fake_symbol_table_impl.h"
#include "common/stats/histogram_impl.h"
#include "common/stats/scope_prefixer.h"
#include "common/stats/symbol_table_creator.h"
#include "common/stats/utility.h"

namespace Envoy {
namespace Stats {

IsolatedStoreImpl::IsolatedStoreImpl()
: IsolatedStoreImpl(std::make_unique<FakeSymbolTableImpl>()) {}
IsolatedStoreImpl::IsolatedStoreImpl() : IsolatedStoreImpl(SymbolTableCreator::makeSymbolTable()) {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use of SymbolTable for the IsolatedStoreImpl used by HostDescriptionImpl and ClusterInfoImpl::load_report_stats_store_ is likely to increase memory noticeably.

Can we continue using FakeSymbolTable for IsolatedStoreImpl?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the reason for this is that you've observed that there is no "." structure in the stat names used in those contexts?

In that case I think you are right --- but there may be other contexts with isolated stats where it does make sense. Also right now isolated stores are used in unit tests for code that would otherwise use the main thread local stats store. Switching them to use fake symbol tables makes those tests behave less like prod

I have an in-progress branch to try to add a stats memory test for large numbers of hosts. Maybe I can send you the diff a bit later and you can get it working?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the reason for this is that you've observed that there is no "." structure in the stat names used in those contexts?

In that case I think you are right --- but there may be other contexts with isolated stats where it does make sense. Also right now isolated stores are used in unit tests for code that would otherwise use the main thread local stats store. Switching them to use fake symbol tables makes those tests behave less like prod

I have an in-progress branch to try to add a stats memory test for large numbers of hosts. Maybe I can send you the diff a bit later and you can get it working?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also @antoniovicente it seems like the better solution is the one you proposed offline -- to make those particular stats just be some atomics and a reference/view to the string-literal name.


IsolatedStoreImpl::IsolatedStoreImpl(std::unique_ptr<SymbolTable>&& symbol_table)
: IsolatedStoreImpl(*symbol_table) {
Expand Down
2 changes: 1 addition & 1 deletion source/common/stats/isolated_store_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class IsolatedStoreImpl : public StoreImpl {
private:
IsolatedStoreImpl(std::unique_ptr<SymbolTable>&& symbol_table);

std::unique_ptr<SymbolTable> symbol_table_storage_;
SymbolTablePtr symbol_table_storage_;
AllocatorImpl alloc_;
IsolatedStatsCache<Counter> counters_;
IsolatedStatsCache<Gauge> gauges_;
Expand Down
24 changes: 24 additions & 0 deletions source/common/stats/symbol_table_creator.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include "common/stats/symbol_table_creator.h"

namespace Envoy {
namespace Stats {

bool SymbolTableCreator::initialized_ = false;
bool SymbolTableCreator::use_fake_symbol_tables_ = true;

SymbolTablePtr SymbolTableCreator::initAndMakeSymbolTable(bool use_fake) {
ASSERT(!initialized_ || (use_fake_symbol_tables_ == use_fake));
initialized_ = true;
use_fake_symbol_tables_ = use_fake;
return makeSymbolTable();
}

SymbolTablePtr SymbolTableCreator::makeSymbolTable() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add some logic in here to make sure we only read one value out of this function? Meaning, IMO we should only ever make 1 type of symbol table in the process. Can we assert that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we've covered that by asserting in initAndMakeSymbolTable above, and by making the setter private with a testing-peer friend.

And we do create different types of symbol tables in tests, so putting an assert at this level would require some kind of test-mode override, like:

  ASSERT(num_fake_symbol_table_created == 0 || num_real_symbol_created == 0 || test_mode);

IMO that doesn't add anything and the assert/private strategy here should be sufficient, but I'm OK adding that if you think it helps. WDYT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't see how this prevents code from using makeSymbolTable() directly before it's initialized the first time? If that variant is only used in tests can we make it private and just use it via the peer? I get that test code might use multiple types, but it seems like we should guard/prevent prod code from using more than one type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right; PTAL again; I think I just needed to set the 'initialized' bit from makeSymblTable to prevent that scenario.

if (use_fake_symbol_tables_) {
return std::make_unique<FakeSymbolTableImpl>();
}
return std::make_unique<SymbolTableImpl>();
}

} // namespace Stats
} // namespace Envoy
57 changes: 57 additions & 0 deletions source/common/stats/symbol_table_creator.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#pragma once

#include "common/stats/fake_symbol_table_impl.h"
#include "common/stats/symbol_table_impl.h"

namespace Envoy {
namespace Stats {

namespace TestUtil {
class SymbolTableCreatorTestPeer;
}

class SymbolTableCreator {
public:
/**
* Initializes the symbol-table creation system. Once this is called, it is a
* runtime assertion to call this again in production code, changing the
* use_fakes setting. However, tests can change the setting via
* TestUtil::SymbolTableCreatorTestPeer::setUseFakeSymbolTables(use_fakes).
*
* @param use_fakes Whether to use fake symbol tables; typically from a command-line option.
* @return a SymbolTable.
*/
static SymbolTablePtr initAndMakeSymbolTable(bool use_fakes);

/**
* Factory method to create SymbolTables. This is needed to help make it
* possible to flag-flip use of real symbol tables, and ultimately should be
* removed.
*
* @return a SymbolTable.
*/
static SymbolTablePtr makeSymbolTable();

/**
* @return whether the system is initialized to use fake symbol tables.
*/
static bool useFakeSymbolTables() { return use_fake_symbol_tables_; }

private:
friend class TestUtil::SymbolTableCreatorTestPeer;

/**
* Sets whether fake or real symbol tables should be used. Tests that alter
* this should restore previous value at the end of the test. This must be
* called via TestUtil::SymbolTableCreatorTestPeer.
*
* *param use_fakes whether to use fake symbol tables.
*/
static void setUseFakeSymbolTables(bool use_fakes) { use_fake_symbol_tables_ = use_fakes; }

static bool initialized_;
static bool use_fake_symbol_tables_;
};

} // namespace Stats
} // namespace Envoy
2 changes: 1 addition & 1 deletion source/exe/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ envoy_cc_library(
"//source/common/api:os_sys_calls_lib",
"//source/common/common:compiler_requirements_lib",
"//source/common/common:perf_annotation_lib",
"//source/common/stats:fake_symbol_table_lib",
"//source/common/stats:symbol_table_creator_lib",
"//source/server:hot_restart_lib",
"//source/server:hot_restart_nop_lib",
"//source/server/config_validation:server_lib",
Expand Down
5 changes: 4 additions & 1 deletion source/exe/main_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "common/common/compiler_requirements.h"
#include "common/common/perf_annotation.h"
#include "common/network/utility.h"
#include "common/stats/symbol_table_creator.h"
#include "common/stats/thread_local_store.h"

#include "server/config_validation/server.h"
Expand Down Expand Up @@ -45,7 +46,9 @@ MainCommonBase::MainCommonBase(const OptionsImpl& options, Event::TimeSystem& ti
Filesystem::Instance& file_system,
std::unique_ptr<ProcessContext> process_context)
: options_(options), component_factory_(component_factory), thread_factory_(thread_factory),
file_system_(file_system), stats_allocator_(symbol_table_) {
file_system_(file_system), symbol_table_(Stats::SymbolTableCreator::initAndMakeSymbolTable(
options_.fakeSymbolTableEnabled())),
stats_allocator_(*symbol_table_) {
switch (options_.mode()) {
case Server::Mode::InitOnly:
case Server::Mode::Serve: {
Expand Down
2 changes: 1 addition & 1 deletion source/exe/main_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ class MainCommonBase {
protected:
ProcessWide process_wide_; // Process-wide state setup/teardown.
const Envoy::OptionsImpl& options_;
Stats::FakeSymbolTableImpl symbol_table_;
Server::ComponentFactory& component_factory_;
Thread::ThreadFactory& thread_factory_;
Filesystem::Instance& file_system_;
Stats::SymbolTablePtr symbol_table_;
Stats::AllocatorImpl stats_allocator_;

std::unique_ptr<ThreadLocal::InstanceImpl> tls_;
Expand Down
1 change: 1 addition & 0 deletions source/server/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ envoy_cc_library(
"//source/common/runtime:runtime_lib",
"//source/common/secret:secret_manager_impl_lib",
"//source/common/singleton:manager_impl_lib",
"//source/common/stats:symbol_table_creator_lib",
"//source/common/stats:thread_local_store_lib",
"//source/common/upstream:cluster_manager_lib",
"//source/common/upstream:health_discovery_service_lib",
Expand Down
8 changes: 6 additions & 2 deletions source/server/options_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ OptionsImpl::OptionsImpl(int argc, const char* const* argv,
TCLAP::ValueArg<bool> use_libevent_buffer("", "use-libevent-buffers",
"Use the original libevent buffer implementation",
false, false, "bool", cmd);

TCLAP::ValueArg<bool> use_fake_symbol_table("", "use-fake-symbol-table",
"Use fake symbol table implementation", false, true,
"bool", cmd);
cmd.setExceptionHandling(false);
try {
cmd.parse(argc, argv);
Expand All @@ -136,6 +138,7 @@ OptionsImpl::OptionsImpl(int argc, const char* const* argv,
mutex_tracing_enabled_ = enable_mutex_tracing.getValue();

libevent_buffer_enabled_ = use_libevent_buffer.getValue();
fake_symbol_table_enabled_ = use_fake_symbol_table.getValue();
cpuset_threads_ = cpuset_threads.getValue();

log_level_ = default_log_level;
Expand Down Expand Up @@ -300,6 +303,7 @@ OptionsImpl::OptionsImpl(const std::string& service_cluster, const std::string&
service_cluster_(service_cluster), service_node_(service_node), service_zone_(service_zone),
file_flush_interval_msec_(10000), drain_time_(600), parent_shutdown_time_(900),
mode_(Server::Mode::Serve), hot_restart_disabled_(false), signal_handling_enabled_(true),
mutex_tracing_enabled_(false), cpuset_threads_(false), libevent_buffer_enabled_(false) {}
mutex_tracing_enabled_(false), cpuset_threads_(false), libevent_buffer_enabled_(false),
fake_symbol_table_enabled_(false) {}

} // namespace Envoy
5 changes: 5 additions & 0 deletions source/server/options_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ class OptionsImpl : public Server::Options, protected Logger::Loggable<Logger::I
void setRejectUnknownFieldsDynamic(bool reject_unknown_dynamic_fields) {
reject_unknown_dynamic_fields_ = reject_unknown_dynamic_fields;
}
void setFakeSymbolTableEnabled(bool fake_symbol_table_enabled) {
fake_symbol_table_enabled_ = fake_symbol_table_enabled;
}

// Server::Options
uint64_t baseId() const override { return base_id_; }
Expand Down Expand Up @@ -117,6 +120,7 @@ class OptionsImpl : public Server::Options, protected Logger::Loggable<Logger::I
bool signalHandlingEnabled() const override { return signal_handling_enabled_; }
bool mutexTracingEnabled() const override { return mutex_tracing_enabled_; }
bool libeventBufferEnabled() const override { return libevent_buffer_enabled_; }
bool fakeSymbolTableEnabled() const override { return fake_symbol_table_enabled_; }
Server::CommandLineOptionsPtr toCommandLineOptions() const override;
void parseComponentLogLevels(const std::string& component_log_levels);
bool cpusetThreadsEnabled() const override { return cpuset_threads_; }
Expand Down Expand Up @@ -152,6 +156,7 @@ class OptionsImpl : public Server::Options, protected Logger::Loggable<Logger::I
bool mutex_tracing_enabled_;
bool cpuset_threads_;
bool libevent_buffer_enabled_;
bool fake_symbol_table_enabled_;
uint32_t count_;
};

Expand Down
4 changes: 2 additions & 2 deletions test/common/grpc/context_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace Grpc {

TEST(GrpcContextTest, ChargeStats) {
NiceMock<Upstream::MockClusterInfo> cluster;
Envoy::Test::Global<Stats::FakeSymbolTableImpl> symbol_table_;
Stats::TestSymbolTable symbol_table_;
Stats::StatNamePool pool(*symbol_table_);
const Stats::StatName service = pool.add("service");
const Stats::StatName method = pool.add("method");
Expand Down Expand Up @@ -58,7 +58,7 @@ TEST(GrpcContextTest, ResolveServiceAndMethod) {
Http::HeaderMapImpl headers;
Http::HeaderEntry& path = headers.insertPath();
path.value(std::string("/service_name/method_name"));
Envoy::Test::Global<Stats::FakeSymbolTableImpl> symbol_table;
Stats::TestSymbolTable symbol_table;
ContextImpl context(*symbol_table);
absl::optional<Context::RequestNames> request_names = context.resolveServiceAndMethod(&path);
EXPECT_TRUE(request_names);
Expand Down
2 changes: 1 addition & 1 deletion test/common/grpc/grpc_client_integration_test_harness.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ class GrpcClientIntegrationTest : public GrpcClientIntegrationParamTest {
FakeHttpConnectionPtr fake_connection_;
std::vector<FakeStreamPtr> fake_streams_;
const Protobuf::MethodDescriptor* method_descriptor_;
Envoy::Test::Global<Stats::FakeSymbolTableImpl> symbol_table_;
Stats::TestSymbolTable symbol_table_;
Stats::IsolatedStoreImpl* stats_store_ = new Stats::IsolatedStoreImpl(*symbol_table_);
Api::ApiPtr api_;
Event::DispatcherPtr dispatcher_;
Expand Down
1 change: 1 addition & 0 deletions test/common/http/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ envoy_cc_fuzz_test(
"//source/common/http:date_provider_lib",
"//source/common/network:address_lib",
"//source/common/network:utility_lib",
"//source/common/stats:symbol_table_creator_lib",
"//test/fuzz:utility_lib",
"//test/mocks/access_log:access_log_mocks",
"//test/mocks/http:http_mocks",
Expand Down
8 changes: 5 additions & 3 deletions test/common/http/codes_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "common/common/empty_string.h"
#include "common/http/codes.h"
#include "common/http/header_map_impl.h"
#include "common/stats/symbol_table_creator.h"

#include "test/mocks/stats/mocks.h"
#include "test/test_common/printers.h"
Expand Down Expand Up @@ -45,7 +46,7 @@ class CodeUtilityTest : public testing::Test {
code_stats_.chargeResponseStat(info);
}

Envoy::Test::Global<Stats::FakeSymbolTableImpl> symbol_table_;
Stats::TestSymbolTable symbol_table_;
Stats::IsolatedStoreImpl global_store_;
Stats::IsolatedStoreImpl cluster_scope_;
Http::CodeStatsImpl code_stats_;
Expand Down Expand Up @@ -276,13 +277,14 @@ TEST_F(CodeUtilityTest, ResponseTimingTest) {

class CodeStatsTest : public testing::Test {
protected:
CodeStatsTest() : code_stats_(symbol_table_) {}
CodeStatsTest()
: symbol_table_(Stats::SymbolTableCreator::makeSymbolTable()), code_stats_(*symbol_table_) {}

absl::string_view stripTrailingDot(absl::string_view prefix) {
return CodeStatsImpl::stripTrailingDot(prefix);
}

Stats::FakeSymbolTableImpl symbol_table_;
Stats::SymbolTablePtr symbol_table_;
CodeStatsImpl code_stats_;
};

Expand Down
5 changes: 3 additions & 2 deletions test/common/http/conn_manager_impl_fuzz_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "common/http/exception.h"
#include "common/network/address_impl.h"
#include "common/network/utility.h"
#include "common/stats/symbol_table_creator.h"

#include "test/common/http/conn_manager_impl_common.h"
#include "test/common/http/conn_manager_impl_fuzz.pb.h"
Expand Down Expand Up @@ -382,8 +383,8 @@ DEFINE_PROTO_FUZZER(const test::common::http::ConnManagerImplTestCase& input) {
FuzzConfig config;
NiceMock<Network::MockDrainDecision> drain_close;
NiceMock<Runtime::MockRandomGenerator> random;
Stats::FakeSymbolTableImpl symbol_table;
Http::ContextImpl http_context(symbol_table);
Stats::SymbolTablePtr symbol_table(Stats::SymbolTableCreator::makeSymbolTable());
Http::ContextImpl http_context(*symbol_table);
NiceMock<Runtime::MockLoader> runtime;
NiceMock<LocalInfo::MockLocalInfo> local_info;
NiceMock<Upstream::MockClusterManager> cluster_manager;
Expand Down
2 changes: 1 addition & 1 deletion test/common/router/config_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class ConfigImplTestBase {
return factory_context_.scope().symbolTable().toString(name);
}

Test::Global<Stats::FakeSymbolTableImpl> symbol_table_;
Stats::TestSymbolTable symbol_table_;
Api::ApiPtr api_;
NiceMock<Server::Configuration::MockFactoryContext> factory_context_;
};
Expand Down
1 change: 1 addition & 0 deletions test/common/stats/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ envoy_cc_test_library(
deps = [
"//source/common/common:assert_lib",
"//source/common/memory:stats_lib",
"//source/common/stats:symbol_table_creator_lib",
],
)

Expand Down
8 changes: 8 additions & 0 deletions test/common/stats/stat_test_utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "common/common/logger.h"
#include "common/memory/stats.h"
#include "common/stats/symbol_table_creator.h"

#include "absl/strings/str_join.h"
#include "absl/strings/string_view.h"
Expand Down Expand Up @@ -104,6 +105,13 @@ class MemoryTest {
} \
} while (false)

class SymbolTableCreatorTestPeer {
public:
static void setUseFakeSymbolTables(bool use_fakes) {
SymbolTableCreator::setUseFakeSymbolTables(use_fakes);
}
};

} // namespace TestUtil
} // namespace Stats
} // namespace Envoy
Loading