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

Side by Side Diff: chrome/browser/net/network_stats.cc

Issue 9705074: Supporting command line argument to force field trials (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed some ooopss... Created 8 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/net/network_stats.h" 5 #include "chrome/browser/net/network_stats.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 probability_per_group = kDivisor; 646 probability_per_group = kDivisor;
647 else if (channel == chrome::VersionInfo::CHANNEL_DEV) 647 else if (channel == chrome::VersionInfo::CHANNEL_DEV)
648 // Enable the connectivity testing for 10% of the users in dev channel. 648 // Enable the connectivity testing for 10% of the users in dev channel.
649 probability_per_group = 100; 649 probability_per_group = 100;
650 else if (channel == chrome::VersionInfo::CHANNEL_BETA) 650 else if (channel == chrome::VersionInfo::CHANNEL_BETA)
651 // Enable the connectivity testing for 5% of the users in beta channel. 651 // Enable the connectivity testing for 5% of the users in beta channel.
652 probability_per_group = 50; 652 probability_per_group = 50;
653 653
654 // After October 30, 2012 builds, it will always be in default group 654 // After October 30, 2012 builds, it will always be in default group
655 // (disable_network_stats). 655 // (disable_network_stats).
656 trial = new base::FieldTrial("NetworkConnectivity", kDivisor, 656 trial = base::FieldTrialList::FactoryGetFieldTrial(
657 "disable_network_stats", 2012, 10, 30); 657 "NetworkConnectivity", kDivisor, "disable_network_stats",
658 2012, 10, 30, NULL);
658 659
659 // Add option to collect_stats for NetworkConnectivity. 660 // Add option to collect_stats for NetworkConnectivity.
660 int collect_stats_group = trial->AppendGroup("collect_stats", 661 int collect_stats_group = trial->AppendGroup("collect_stats",
661 probability_per_group); 662 probability_per_group);
662 if (trial->group() == collect_stats_group) 663 if (trial->group() == collect_stats_group)
663 collect_stats = true; 664 collect_stats = true;
664 665
665 if (collect_stats) { 666 if (collect_stats) {
666 // Pick a port randomly from the set of TCP/UDP echo server ports 667 // Pick a port randomly from the set of TCP/UDP echo server ports
667 // specified in |kPorts|. 668 // specified in |kPorts|.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 host_resolver, tcp_server_address, histogram_port, 708 host_resolver, tcp_server_address, histogram_port,
708 kSmallTestBytesToSend, net::CompletionCallback()); 709 kSmallTestBytesToSend, net::CompletionCallback());
709 710
710 TCPStatsClient* large_tcp_client = new TCPStatsClient(); 711 TCPStatsClient* large_tcp_client = new TCPStatsClient();
711 large_tcp_client->Start( 712 large_tcp_client->Start(
712 host_resolver, tcp_server_address, histogram_port, 713 host_resolver, tcp_server_address, histogram_port,
713 kLargeTestBytesToSend, net::CompletionCallback()); 714 kLargeTestBytesToSend, net::CompletionCallback());
714 } 715 }
715 716
716 } // namespace chrome_browser_net 717 } // namespace chrome_browser_net
OLDNEW
« no previous file with comments | « chrome/browser/net/http_pipelining_compatibility_client.cc ('k') | chrome/browser/prerender/prerender_field_trial.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698