Commit f283e391 authored by Tarun Bansal's avatar Tarun Bansal Committed by Commit Bot

Enable the experiment to delay low priority requests on multiplexed connections

Enable the experiment to delay low priority requests on multiplexed connections.
net-dev thread: https://groups.google.com/a/chromium.org/forum/#!topic/net-dev/abRbGlGlNd0
loading-dev thread: https://groups.google.com/a/chromium.org/forum/#!topic/loading-dev/s22tVFiDru0
predictability-advice: http://shortn/_WJaP3jsRbk

Cq-Include-Trybots: luci.chromium.try:linux_mojo
Change-Id: I6141733ec7bfbd45c6b3c3d8ed98857104dee442
Bug: 836552
Reviewed-on: https://chromium-review.googlesource.com/c/1257677Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Tarun Bansal <tbansal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596129}
parent a2959bab
...@@ -40,7 +40,7 @@ const base::Feature kThrottleDelayable{"ThrottleDelayable", ...@@ -40,7 +40,7 @@ const base::Feature kThrottleDelayable{"ThrottleDelayable",
// ResourceScheduler just as HTTP/1.1 resources are. However, requests from such // ResourceScheduler just as HTTP/1.1 resources are. However, requests from such
// servers are not subject to kMaxNumDelayableRequestsPerHostPerClient limit. // servers are not subject to kMaxNumDelayableRequestsPerHostPerClient limit.
const base::Feature kDelayRequestsOnMultiplexedConnections{ const base::Feature kDelayRequestsOnMultiplexedConnections{
"DelayRequestsOnMultiplexedConnections", base::FEATURE_DISABLED_BY_DEFAULT}; "DelayRequestsOnMultiplexedConnections", base::FEATURE_ENABLED_BY_DEFAULT};
} // namespace features } // namespace features
} // namespace network } // namespace network
...@@ -87,8 +87,10 @@ ResourceSchedulerParamsManager:: ...@@ -87,8 +87,10 @@ ResourceSchedulerParamsManager::
features::kDelayRequestsOnMultiplexedConnections, features::kDelayRequestsOnMultiplexedConnections,
"MaxEffectiveConnectionType")); "MaxEffectiveConnectionType"));
if (!max_effective_connection_type) if (!max_effective_connection_type) {
return result; // Use a default value if one is not set using field trial params.
max_effective_connection_type = net::EFFECTIVE_CONNECTION_TYPE_3G;
}
for (int ect = net::EFFECTIVE_CONNECTION_TYPE_SLOW_2G; for (int ect = net::EFFECTIVE_CONNECTION_TYPE_SLOW_2G;
ect <= max_effective_connection_type.value(); ++ect) { ect <= max_effective_connection_type.value(); ++ect) {
......
...@@ -87,7 +87,6 @@ class ResourceSchedulerParamsManagerTest : public testing::Test { ...@@ -87,7 +87,6 @@ class ResourceSchedulerParamsManagerTest : public testing::Test {
switch (effective_connection_type) { switch (effective_connection_type) {
case net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN: case net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN:
case net::EFFECTIVE_CONNECTION_TYPE_OFFLINE: case net::EFFECTIVE_CONNECTION_TYPE_OFFLINE:
case net::EFFECTIVE_CONNECTION_TYPE_3G:
case net::EFFECTIVE_CONNECTION_TYPE_4G: case net::EFFECTIVE_CONNECTION_TYPE_4G:
EXPECT_EQ(10u, resource_scheduler_params_manager EXPECT_EQ(10u, resource_scheduler_params_manager
.GetParamsForEffectiveConnectionType( .GetParamsForEffectiveConnectionType(
...@@ -102,7 +101,20 @@ class ResourceSchedulerParamsManagerTest : public testing::Test { ...@@ -102,7 +101,20 @@ class ResourceSchedulerParamsManagerTest : public testing::Test {
.GetParamsForEffectiveConnectionType(effective_connection_type) .GetParamsForEffectiveConnectionType(effective_connection_type)
.delay_requests_on_multiplexed_connections); .delay_requests_on_multiplexed_connections);
return; return;
case net::EFFECTIVE_CONNECTION_TYPE_3G:
EXPECT_EQ(10u, resource_scheduler_params_manager
.GetParamsForEffectiveConnectionType(
effective_connection_type)
.max_delayable_requests);
EXPECT_EQ(0.0, resource_scheduler_params_manager
.GetParamsForEffectiveConnectionType(
effective_connection_type)
.non_delayable_weight);
EXPECT_TRUE(
resource_scheduler_params_manager
.GetParamsForEffectiveConnectionType(effective_connection_type)
.delay_requests_on_multiplexed_connections);
return;
case net::EFFECTIVE_CONNECTION_TYPE_SLOW_2G: case net::EFFECTIVE_CONNECTION_TYPE_SLOW_2G:
case net::EFFECTIVE_CONNECTION_TYPE_2G: case net::EFFECTIVE_CONNECTION_TYPE_2G:
EXPECT_EQ(8u, resource_scheduler_params_manager EXPECT_EQ(8u, resource_scheduler_params_manager
...@@ -113,7 +125,7 @@ class ResourceSchedulerParamsManagerTest : public testing::Test { ...@@ -113,7 +125,7 @@ class ResourceSchedulerParamsManagerTest : public testing::Test {
.GetParamsForEffectiveConnectionType( .GetParamsForEffectiveConnectionType(
effective_connection_type) effective_connection_type)
.non_delayable_weight); .non_delayable_weight);
EXPECT_FALSE( EXPECT_TRUE(
resource_scheduler_params_manager resource_scheduler_params_manager
.GetParamsForEffectiveConnectionType(effective_connection_type) .GetParamsForEffectiveConnectionType(effective_connection_type)
.delay_requests_on_multiplexed_connections); .delay_requests_on_multiplexed_connections);
...@@ -184,6 +196,17 @@ TEST_F(ResourceSchedulerParamsManagerTest, ...@@ -184,6 +196,17 @@ TEST_F(ResourceSchedulerParamsManagerTest,
.GetParamsForEffectiveConnectionType(ect) .GetParamsForEffectiveConnectionType(ect)
.delay_requests_on_multiplexed_connections); .delay_requests_on_multiplexed_connections);
} else if (effective_connection_type == net::EFFECTIVE_CONNECTION_TYPE_3G) {
EXPECT_EQ(10u, resource_scheduler_params_manager
.GetParamsForEffectiveConnectionType(ect)
.max_delayable_requests);
EXPECT_EQ(0.0, resource_scheduler_params_manager
.GetParamsForEffectiveConnectionType(ect)
.non_delayable_weight);
EXPECT_FALSE(resource_scheduler_params_manager
.GetParamsForEffectiveConnectionType(ect)
.delay_requests_on_multiplexed_connections);
} else { } else {
VerifyDefaultParams( VerifyDefaultParams(
resource_scheduler_params_manager, resource_scheduler_params_manager,
......
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