-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
time: Rename time_source_ and timeSource() to time_system_ and timeSystem() as appropriate #4343
Changes from all commits
362bebb
f87fa85
3a96c34
c555ccc
144864e
fbde0e8
dcef91f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,7 +165,7 @@ class GoogleAsyncClientImpl final : public AsyncClient, Logger::Loggable<Logger: | |
AsyncStream* start(const Protobuf::MethodDescriptor& service_method, | ||
AsyncStreamCallbacks& callbacks) override; | ||
|
||
TimeSource& timeSource() { return dispatcher_.timeSource(); } | ||
TimeSource& timeSource() { return dispatcher_.timeSystem(); } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto |
||
|
||
private: | ||
static std::shared_ptr<grpc::Channel> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,7 +180,7 @@ ClusterManagerImpl::ClusterManagerImpl(const envoy::config::bootstrap::v2::Boots | |
init_helper_([this](Cluster& cluster) { onClusterInit(cluster); }), | ||
config_tracker_entry_( | ||
admin.getConfigTracker().add("clusters", [this] { return dumpClusterConfigs(); })), | ||
time_source_(main_thread_dispatcher.timeSource()), dispatcher_(main_thread_dispatcher) { | ||
time_source_(main_thread_dispatcher.timeSystem()), dispatcher_(main_thread_dispatcher) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also |
||
async_client_manager_ = std::make_unique<Grpc::AsyncClientManagerImpl>(*this, tls, time_source_); | ||
const auto& cm_config = bootstrap.cluster_manager(); | ||
if (cm_config.has_outlier_detection()) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ LoadStatsReporter::LoadStatsReporter(const LocalInfo::LocalInfo& local_info, | |
async_client_(std::move(async_client)), | ||
service_method_(*Protobuf::DescriptorPool::generated_pool()->FindMethodByName( | ||
"envoy.service.load_stats.v2.LoadReportingService.StreamLoadStats")), | ||
time_source_(dispatcher.timeSource()) { | ||
time_source_(dispatcher.timeSystem()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. .. and more :) |
||
request_.mutable_node()->MergeFrom(local_info.node()); | ||
retry_timer_ = dispatcher.createTimer([this]() -> void { establishNewStream(); }); | ||
response_timer_ = dispatcher.createTimer([this]() -> void { sendLoadStatsRequest(); }); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one seems to still not match.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WAI. The dispatcher keeps a TimeSystem because it works with timers. However, gRPC doesn't care about timers (yet) so it needs only a TimeSource. So when testing this, all you need is (say) a MockTimeSource, and don't need to set up a whole TimeSystem.
This is true with all the cases below as well.