Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Unified Diff: net/nqe/network_quality_estimator.cc

Issue 2643213003: NQE: Add net log events when there is a significant change in metrics (Closed)
Patch Set: ryansturm comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/nqe/network_quality_estimator.h ('k') | net/nqe/network_quality_estimator_test_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/nqe/network_quality_estimator.cc
diff --git a/net/nqe/network_quality_estimator.cc b/net/nqe/network_quality_estimator.cc
index 4950bef439455a9290f23e0bc4498969909ec820..d70f909dfa9f35ce953f35370b224642e4fabce5 100644
--- a/net/nqe/network_quality_estimator.cc
+++ b/net/nqe/network_quality_estimator.cc
@@ -33,7 +33,6 @@
#include "net/http/http_response_headers.h"
#include "net/http/http_response_info.h"
#include "net/http/http_status_code.h"
-#include "net/nqe/event_creator.h"
#include "net/nqe/network_quality_estimator_params.h"
#include "net/nqe/socket_watcher_factory.h"
#include "net/nqe/throughput_analyzer.h"
@@ -290,7 +289,7 @@ NetworkQualityEstimator::NetworkQualityEstimator(
variation_params)),
forced_effective_connection_type_(
nqe::internal::forced_effective_connection_type(variation_params)),
- net_log_(net_log),
+ event_creator_(net_log),
weak_ptr_factory_(this) {
// None of the algorithms can have an empty name.
DCHECK(algorithm_name_to_enum_.end() ==
@@ -747,12 +746,9 @@ void NetworkQualityEstimator::ReportEffectiveConnectionTypeForTesting(
EffectiveConnectionType effective_connection_type) {
DCHECK(thread_checker_.CalledOnValidThread());
- nqe::internal::AddEffectiveConnectionTypeChangedEventToNetLog(
- net_log_, typical_network_quality_[effective_connection_type].http_rtt(),
- typical_network_quality_[effective_connection_type].transport_rtt(),
- typical_network_quality_[effective_connection_type]
- .downstream_throughput_kbps(),
- effective_connection_type);
+ event_creator_.MaybeAddEffectiveConnectionTypeChangedEventToNetLog(
+ effective_connection_type_,
+ typical_network_quality_[effective_connection_type]);
for (auto& observer : effective_connection_type_observer_list_)
observer.OnEffectiveConnectionTypeChanged(effective_connection_type);
@@ -1042,6 +1038,9 @@ void NetworkQualityEstimator::ComputeEffectiveConnectionType() {
if (past_type != effective_connection_type_)
NotifyObserversOfEffectiveConnectionTypeChanged();
+ event_creator_.MaybeAddEffectiveConnectionTypeChangedEventToNetLog(
+ effective_connection_type_, network_quality_);
+
rtt_observations_size_at_last_ect_computation_ = rtt_observations_.Size();
throughput_observations_size_at_last_ect_computation_ =
downstream_throughput_kbps_observations_.Size();
@@ -1587,11 +1586,6 @@ void NetworkQualityEstimator::
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK_NE(EFFECTIVE_CONNECTION_TYPE_LAST, effective_connection_type_);
- nqe::internal::AddEffectiveConnectionTypeChangedEventToNetLog(
- net_log_, network_quality_.http_rtt(), network_quality_.transport_rtt(),
- network_quality_.downstream_throughput_kbps(),
- effective_connection_type_);
-
// TODO(tbansal): Add hysteresis in the notification.
for (auto& observer : effective_connection_type_observer_list_)
observer.OnEffectiveConnectionTypeChanged(effective_connection_type_);
« no previous file with comments | « net/nqe/network_quality_estimator.h ('k') | net/nqe/network_quality_estimator_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698