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

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

Issue 2186803003: Add UMA Precache.CacheStatus.NonPrefetch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed PrecacheManagerTests 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 173 }
174 174
175 void PrecacheDatabase::RecordURLNonPrefetch(const GURL& url, 175 void PrecacheDatabase::RecordURLNonPrefetch(const GURL& url,
176 const base::TimeDelta& latency, 176 const base::TimeDelta& latency,
177 const base::Time& fetch_time, 177 const base::Time& fetch_time,
178 const net::HttpResponseInfo& info, 178 const net::HttpResponseInfo& info,
179 int64_t size, 179 int64_t size,
180 int host_rank, 180 int host_rank,
181 bool is_connection_cellular) { 181 bool is_connection_cellular) {
182 UMA_HISTOGRAM_TIMES("Precache.Latency.NonPrefetch", latency); 182 UMA_HISTOGRAM_TIMES("Precache.Latency.NonPrefetch", latency);
183 UMA_HISTOGRAM_ENUMERATION("Precache.CacheStatus.NonPrefetch",
184 info.cache_entry_status,
185 net::HttpResponseInfo::CacheEntryStatus::ENTRY_MAX);
183 186
184 if (host_rank != history::kMaxTopHosts) { 187 if (host_rank != history::kMaxTopHosts) {
185 // The resource was loaded on a page that could have been affected by 188 // The resource was loaded on a page that could have been affected by
186 // precaching. 189 // precaching.
187 UMA_HISTOGRAM_TIMES("Precache.Latency.NonPrefetch.TopHosts", latency); 190 UMA_HISTOGRAM_TIMES("Precache.Latency.NonPrefetch.TopHosts", latency);
188 } else { 191 } else {
189 // The resource was loaded on a page that could NOT have been affected by 192 // The resource was loaded on a page that could NOT have been affected by
190 // precaching. 193 // precaching.
191 UMA_HISTOGRAM_TIMES("Precache.Latency.NonPrefetch.NonTopHosts", latency); 194 UMA_HISTOGRAM_TIMES("Precache.Latency.NonPrefetch.NonTopHosts", latency);
192 } 195 }
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 352
350 void PrecacheDatabase::DeleteUnfinishedWork() { 353 void PrecacheDatabase::DeleteUnfinishedWork() {
351 precache_session_table_.DeleteUnfinishedWork(); 354 precache_session_table_.DeleteUnfinishedWork();
352 } 355 }
353 356
354 base::WeakPtr<PrecacheDatabase> PrecacheDatabase::GetWeakPtr() { 357 base::WeakPtr<PrecacheDatabase> PrecacheDatabase::GetWeakPtr() {
355 return weak_factory_.GetWeakPtr(); 358 return weak_factory_.GetWeakPtr();
356 } 359 }
357 360
358 } // namespace precache 361 } // 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