Skip to content

Commit

Permalink
patches from envoyproxy#6299
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Marantz <[email protected]>
  • Loading branch information
jmarantz committed Mar 19, 2019
1 parent 9449596 commit 61ea4e2
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 12 deletions.
5 changes: 0 additions & 5 deletions include/envoy/server/instance.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,6 @@ class Instance {
*/
virtual TimeSource& timeSource() PURE;

/**
* @return the statistics symbol table.
*/
virtual Stats::SymbolTable& symbolTable() PURE;

/**
* @return the flush interval of stats sinks.
*/
Expand Down
2 changes: 1 addition & 1 deletion source/common/stats/isolated_store_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Stats {
IsolatedStoreImpl::IsolatedStoreImpl()
: IsolatedStoreImpl(std::make_unique<FakeSymbolTableImpl>()) {}

IsolatedStoreImpl::IsolatedStoreImpl(std::unique_ptr<SymbolTable> symbol_table)
IsolatedStoreImpl::IsolatedStoreImpl(std::unique_ptr<SymbolTable>&& symbol_table)
: IsolatedStoreImpl(*symbol_table) {
symbol_table_storage_ = std::move(symbol_table);
}
Expand Down
3 changes: 2 additions & 1 deletion source/common/stats/isolated_store_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ template <class Base> class IsolatedStatsCache {
class IsolatedStoreImpl : public Store {
public:
IsolatedStoreImpl();
explicit IsolatedStoreImpl(std::unique_ptr<SymbolTable> symbol_table);
explicit IsolatedStoreImpl(SymbolTable& symbol_table);

// Stats::Scope
Expand Down Expand Up @@ -99,6 +98,8 @@ class IsolatedStoreImpl : public Store {
void clear();

private:
IsolatedStoreImpl(std::unique_ptr<SymbolTable>&& symbol_table);

std::unique_ptr<SymbolTable> symbol_table_storage_;
SymbolTable& symbol_table_;
HeapStatDataAllocator alloc_;
Expand Down
4 changes: 2 additions & 2 deletions source/extensions/stat_sinks/hystrix/hystrix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -268,15 +268,15 @@ const std::string HystrixSink::printRollingWindows() {
HystrixSink::HystrixSink(Server::Instance& server, const uint64_t num_buckets)
: server_(server), current_index_(num_buckets > 0 ? num_buckets : DEFAULT_NUM_BUCKETS),
window_size_(current_index_ + 1),
cluster_upstream_rq_time_("cluster.upstream_rq_time", server.symbolTable()) {
cluster_upstream_rq_time_("cluster.upstream_rq_time", server.stats().symbolTable()) {
Server::Admin& admin = server_.admin();
ENVOY_LOG(debug,
"adding hystrix_event_stream endpoint to enable connection to hystrix dashboard");
admin.addHandler("/hystrix_event_stream", "send hystrix event stream",
MAKE_ADMIN_HANDLER(handlerHystrixEventStream), false, false);
}

HystrixSink::~HystrixSink() { cluster_upstream_rq_time_.free(server_.symbolTable()); }
HystrixSink::~HystrixSink() { cluster_upstream_rq_time_.free(server_.stats().symbolTable()); }

Http::Code HystrixSink::handlerHystrixEventStream(absl::string_view,
Http::HeaderMap& response_headers,
Expand Down
1 change: 0 additions & 1 deletion source/server/config_validation/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ class ValidationInstance : Logger::Loggable<Logger::Id::main>,
Http::Context& httpContext() override { return http_context_; }
ThreadLocal::Instance& threadLocal() override { return thread_local_; }
const LocalInfo::LocalInfo& localInfo() override { return *local_info_; }
Stats::SymbolTable& symbolTable() override { return stats_store_.symbolTable(); }
TimeSource& timeSource() override { return api_->timeSource(); }
Envoy::MutexTracer* mutexTracer() override { return mutex_tracer_; }

Expand Down
1 change: 0 additions & 1 deletion source/server/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ class InstanceImpl : Logger::Loggable<Logger::Id::main>, public Instance {
Http::Context& httpContext() override { return http_context_; }
ThreadLocal::Instance& threadLocal() override { return thread_local_; }
const LocalInfo::LocalInfo& localInfo() override { return *local_info_; }
Stats::SymbolTable& symbolTable() override { return stats_store_.symbolTable(); }
TimeSource& timeSource() override { return time_source_; }

std::chrono::milliseconds statsFlushInterval() const override {
Expand Down
1 change: 0 additions & 1 deletion test/mocks/server/mocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@ class MockInstance : public Instance {
MOCK_METHOD0(localInfo, const LocalInfo::LocalInfo&());
MOCK_CONST_METHOD0(statsFlushInterval, std::chrono::milliseconds());

Stats::SymbolTable& symbolTable() override { return stats_store_.symbolTable(); }
TimeSource& timeSource() override { return time_system_; }

std::unique_ptr<Secret::SecretManager> secret_manager_;
Expand Down

0 comments on commit 61ea4e2

Please sign in to comment.