-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
instance_impl.cc
40 lines (33 loc) · 1.71 KB
/
instance_impl.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "source/server/instance_impl.h"
#include "source/common/upstream/health_discovery_service.h"
#include "source/server/guarddog_impl.h"
#include "source/server/null_overload_manager.h"
#include "source/server/overload_manager_impl.h"
namespace Envoy {
namespace Server {
void InstanceImpl::maybeCreateHeapShrinker() {
heap_shrinker_ =
std::make_unique<Memory::HeapShrinker>(dispatcher(), overloadManager(), *stats().rootScope());
}
absl::StatusOr<std::unique_ptr<OverloadManager>> InstanceImpl::createOverloadManager() {
return OverloadManagerImpl::create(
dispatcher(), *stats().rootScope(), threadLocal(), bootstrap().overload_manager(),
messageValidationContext().staticValidationVisitor(), api(), options());
}
std::unique_ptr<OverloadManager> InstanceImpl::createNullOverloadManager() {
return std::make_unique<NullOverloadManager>(threadLocal(), false);
}
std::unique_ptr<Server::GuardDog> InstanceImpl::maybeCreateGuardDog(absl::string_view name) {
return std::make_unique<Server::GuardDogImpl>(*stats().rootScope(),
config().mainThreadWatchdogConfig(), api(), name);
}
std::unique_ptr<HdsDelegateApi>
InstanceImpl::maybeCreateHdsDelegate(Configuration::ServerFactoryContext& server_context,
Stats::Scope& scope, Grpc::RawAsyncClientPtr&& async_client,
Envoy::Stats::Store& stats,
Ssl::ContextManager& ssl_context_manager) {
return std::make_unique<Upstream::HdsDelegate>(server_context, scope, std::move(async_client),
stats, ssl_context_manager);
}
} // namespace Server
} // namespace Envoy