Commit 6c4f0cfe authored by Tarun Bansal's avatar Tarun Bansal Committed by Commit Bot

NQE: Discard RTT and throughput observations from non-GET requests

Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet
Bug: 782780
Change-Id: I419786e99fa6f794d5c84041f131254588328d9f
Reviewed-on: https://chromium-review.googlesource.com/758721
Commit-Queue: Tarun Bansal <tbansal@chromium.org>
Reviewed-by: default avatarRyan Sturm <ryansturm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515061}
parent 06970f10
...@@ -738,7 +738,8 @@ bool NetworkQualityEstimator::RequestProvidesRTTObservation( ...@@ -738,7 +738,8 @@ bool NetworkQualityEstimator::RequestProvidesRTTObservation(
// response is not cached. // response is not cached.
!request.response_info().response_time.is_null() && !request.response_info().response_time.is_null() &&
!request.was_cached() && !request.was_cached() &&
request.creation_time() >= last_connection_change_; request.creation_time() >= last_connection_change_ &&
request.method() == "GET";
} }
void NetworkQualityEstimator::RecordExternalEstimateProviderMetrics( void NetworkQualityEstimator::RecordExternalEstimateProviderMetrics(
......
...@@ -29,6 +29,12 @@ namespace { ...@@ -29,6 +29,12 @@ namespace {
// degrade accuracy held in the memory. // degrade accuracy held in the memory.
static const size_t kMaxRequestsSize = 300; static const size_t kMaxRequestsSize = 300;
// Returns true if the request should be discarded because it does not provide
// meaningful observation.
bool ShouldDiscardRequest(const URLRequest& request) {
return request.method() != "GET";
}
} // namespace } // namespace
namespace nqe { namespace nqe {
...@@ -136,6 +142,8 @@ void ThroughputAnalyzer::NotifyStartTransaction(const URLRequest& request) { ...@@ -136,6 +142,8 @@ void ThroughputAnalyzer::NotifyStartTransaction(const URLRequest& request) {
EndThroughputObservationWindow(); EndThroughputObservationWindow();
DCHECK(!IsCurrentlyTrackingThroughput()); DCHECK(!IsCurrentlyTrackingThroughput());
return; return;
} else if (ShouldDiscardRequest(request)) {
return;
} }
EraseHangingRequests(request); EraseHangingRequests(request);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment