diff options
-rw-r--r-- | net/disk_cache/backend_impl.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc index adffbc7..e02b79d 100644 --- a/net/disk_cache/backend_impl.cc +++ b/net/disk_cache/backend_impl.cc @@ -174,7 +174,12 @@ bool SetFieldTrialInfo(int size_group) { std::string group1 = base::StringPrintf("CacheSizeGroup_%d", size_group); trial1->AppendGroup(group1, base::FieldTrial::kAllRemainingProbability); - return false; + scoped_refptr<base::FieldTrial> trial2 = + new base::FieldTrial("CacheThrottle", 100); + int group2a = trial2->AppendGroup("CacheThrottle_On", 10); // 10 % in. + trial2->AppendGroup("CacheThrottle_Off", 10); // 10 % control. + + return trial2->group() == group2a; } // ------------------------------------------------------------------------ @@ -1209,6 +1214,10 @@ void BackendImpl::OnOperationCompleted(base::TimeDelta elapsed_time) { if (cache_type() != net::DISK_CACHE) return; + UMA_HISTOGRAM_TIMES(base::FieldTrial::MakeName("DiskCache.TotalIOTime", + "CacheThrottle").data(), + elapsed_time); + if (!throttle_requests_) return; |