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

Side by Side Diff: components/precache/core/precache_database.cc

Issue 2200863002: Add UMA Precache.CacheStatus.NonPrefetch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 4 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/precache/core/precache_database.h" 5 #include "components/precache/core/precache_database.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 148 }
149 149
150 void PrecacheDatabase::RecordURLNonPrefetch(const GURL& url, 150 void PrecacheDatabase::RecordURLNonPrefetch(const GURL& url,
151 const base::TimeDelta& latency, 151 const base::TimeDelta& latency,
152 const base::Time& fetch_time, 152 const base::Time& fetch_time,
153 const net::HttpResponseInfo& info, 153 const net::HttpResponseInfo& info,
154 int64_t size, 154 int64_t size,
155 int host_rank, 155 int host_rank,
156 bool is_connection_cellular) { 156 bool is_connection_cellular) {
157 UMA_HISTOGRAM_TIMES("Precache.Latency.NonPrefetch", latency); 157 UMA_HISTOGRAM_TIMES("Precache.Latency.NonPrefetch", latency);
158 UMA_HISTOGRAM_ENUMERATION("Precache.CacheStatus.NonPrefetch",
159 info.cache_entry_status,
160 net::HttpResponseInfo::CacheEntryStatus::ENTRY_MAX);
158 161
159 if (host_rank != history::kMaxTopHosts) { 162 if (host_rank != history::kMaxTopHosts) {
160 // The resource was loaded on a page that could have been affected by 163 // The resource was loaded on a page that could have been affected by
161 // precaching. 164 // precaching.
162 UMA_HISTOGRAM_TIMES("Precache.Latency.NonPrefetch.TopHosts", latency); 165 UMA_HISTOGRAM_TIMES("Precache.Latency.NonPrefetch.TopHosts", latency);
163 } else { 166 } else {
164 // The resource was loaded on a page that could NOT have been affected by 167 // The resource was loaded on a page that could NOT have been affected by
165 // precaching. 168 // precaching.
166 UMA_HISTOGRAM_TIMES("Precache.Latency.NonPrefetch.NonTopHosts", latency); 169 UMA_HISTOGRAM_TIMES("Precache.Latency.NonPrefetch.NonTopHosts", latency);
167 } 170 }
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 306
304 void PrecacheDatabase::DeleteUnfinishedWork() { 307 void PrecacheDatabase::DeleteUnfinishedWork() {
305 precache_session_table_.DeleteUnfinishedWork(); 308 precache_session_table_.DeleteUnfinishedWork();
306 } 309 }
307 310
308 base::WeakPtr<PrecacheDatabase> PrecacheDatabase::GetWeakPtr() { 311 base::WeakPtr<PrecacheDatabase> PrecacheDatabase::GetWeakPtr() {
309 return weak_factory_.GetWeakPtr(); 312 return weak_factory_.GetWeakPtr();
310 } 313 }
311 314
312 } // namespace precache 315 } // namespace precache
OLDNEW
« no previous file with comments | « components/precache/content/precache_manager_unittest.cc ('k') | components/precache/core/precache_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698