summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-24 21:32:06 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-24 21:32:06 +0000
commit5683565df217b3d7cdf8d91759bd4e18a0c7c8bf (patch)
tree6e079af8674cfe2f229b49331d3b87e39e64a7ec
parent0e4f68db63e565201a6eaa2f600441c37b150d1b (diff)
downloadchromium_src-5683565df217b3d7cdf8d91759bd4e18a0c7c8bf.zip
chromium_src-5683565df217b3d7cdf8d91759bd4e18a0c7c8bf.tar.gz
chromium_src-5683565df217b3d7cdf8d91759bd4e18a0c7c8bf.tar.bz2
Disk Cache: Add more clients to the current experiment.
For some reason, I have less than 1% of clients taking part of the eviction algorithm experiment, so I'm adding clients again. BUG=none TEST=none Review URL: http://codereview.chromium.org/147066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19175 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--net/disk_cache/backend_impl.cc26
1 files changed, 21 insertions, 5 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc
index be7292d..5f7eb93 100644
--- a/net/disk_cache/backend_impl.cc
+++ b/net/disk_cache/backend_impl.cc
@@ -8,6 +8,7 @@
#include "base/file_util.h"
#include "base/histogram.h"
#include "base/message_loop.h"
+#include "base/rand_util.h"
#include "base/string_util.h"
#include "base/sys_info.h"
#include "base/timer.h"
@@ -139,14 +140,29 @@ bool DelayedCacheCleanup(const std::wstring& full_path) {
// Sets |current_group| for the current experiment. Returns false if the files
// should be discarded.
bool InitExperiment(int* current_group) {
- if (*current_group <= 2) {
- // Not taking part of this experiment.
- *current_group = 5;
- } else if (*current_group < 5) {
+ if (*current_group == 3 || *current_group == 4) {
// Discard current cache for groups 3 and 4.
return false;
}
+ if (*current_group <= 5) {
+ // Re-load the two groups.
+ int option = base::RandInt(0, 9);
+
+ if (option > 1) {
+ // 80% will be out of the experiment.
+ *current_group = 9;
+ } else {
+ *current_group = option + 6;
+ }
+ }
+
+ // The current groups should be:
+ // 6 control. (~10%)
+ // 7 new eviction, upgraded data. (~10%)
+ // 8 new eviction, from new files.
+ // 9 out. (~80%)
+
UMA_HISTOGRAM_CACHE_ERROR("DiskCache.Experiment", *current_group);
// Current experiment already set.
@@ -253,7 +269,7 @@ bool BackendImpl::Init() {
if (!InitExperiment(&data_->header.experiment))
return false;
- if (data_->header.experiment > 6)
+ if (data_->header.experiment > 6 && data_->header.experiment < 9)
new_eviction_ = true;
if (!CheckIndex()) {