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

Side by Side Diff: content/browser/download/download_stats.cc

Issue 10074001: Initial implementation of the ByteStream refactor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Checkpoint and merge to LKGR. Created 8 years, 7 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 | Annotate | Revision Log
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 "content/browser/download/download_stats.h" 5 #include "content/browser/download/download_stats.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "content/browser/download/download_resource_handler.h" 9 #include "content/browser/download/download_resource_handler.h"
10 #include "content/public/browser/download_interrupt_reasons.h" 10 #include "content/public/browser/download_interrupt_reasons.h"
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 248
249 // Record the value. 249 // Record the value.
250 UMA_HISTOGRAM_ENUMERATION("Download.ContentType", 250 UMA_HISTOGRAM_ENUMERATION("Download.ContentType",
251 download_content, 251 download_content,
252 DOWNLOAD_CONTENT_MAX); 252 DOWNLOAD_CONTENT_MAX);
253 } 253 }
254 254
255 void RecordFileThreadReceiveBuffers(size_t num_buffers) { 255 void RecordFileThreadReceiveBuffers(size_t num_buffers) {
256 UMA_HISTOGRAM_CUSTOM_COUNTS( 256 UMA_HISTOGRAM_CUSTOM_COUNTS(
257 "Download.FileThreadReceiveBuffers", num_buffers, 1, 257 "Download.FileThreadReceiveBuffers", num_buffers, 1,
258 DownloadResourceHandler::kLoadsToWrite, 258 100, 100);
259 DownloadResourceHandler::kLoadsToWrite);
260 } 259 }
261 260
262 void RecordBandwidth(double actual_bandwidth, double potential_bandwidth) { 261 void RecordBandwidth(double actual_bandwidth, double potential_bandwidth) {
263 UMA_HISTOGRAM_CUSTOM_COUNTS( 262 UMA_HISTOGRAM_CUSTOM_COUNTS(
264 "Download.ActualBandwidth", actual_bandwidth, 1, 1000000000, 50); 263 "Download.ActualBandwidth", actual_bandwidth, 1, 1000000000, 50);
265 UMA_HISTOGRAM_CUSTOM_COUNTS( 264 UMA_HISTOGRAM_CUSTOM_COUNTS(
266 "Download.PotentialBandwidth", potential_bandwidth, 1, 1000000000, 50); 265 "Download.PotentialBandwidth", potential_bandwidth, 1, 1000000000, 50);
267 UMA_HISTOGRAM_PERCENTAGE( 266 UMA_HISTOGRAM_PERCENTAGE(
268 "Download.BandwidthUsed", 267 "Download.BandwidthUsed",
269 (int) ((actual_bandwidth * 100)/ potential_bandwidth)); 268 (int) ((actual_bandwidth * 100)/ potential_bandwidth));
(...skipping 26 matching lines...) Expand all
296 } 295 }
297 296
298 void RecordOpensOutstanding(int size) { 297 void RecordOpensOutstanding(int size) {
299 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.OpensOutstanding", 298 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.OpensOutstanding",
300 size, 299 size,
301 0/*min*/, 300 0/*min*/,
302 (1 << 10)/*max*/, 301 (1 << 10)/*max*/,
303 64/*num_buckets*/); 302 64/*num_buckets*/);
304 } 303 }
305 304
305 void RecordContiguousWriteTime(base::TimeDelta time_blocked) {
306 UMA_HISTOGRAM_TIMES("Download.FileThreadBlockedTime", time_blocked);
307 }
308
306 void RecordSavePackageEvent(SavePackageEvent event) { 309 void RecordSavePackageEvent(SavePackageEvent event) {
307 UMA_HISTOGRAM_ENUMERATION("Download.SavePackage", 310 UMA_HISTOGRAM_ENUMERATION("Download.SavePackage",
308 event, 311 event,
309 SAVE_PACKAGE_LAST_ENTRY); 312 SAVE_PACKAGE_LAST_ENTRY);
310 } 313 }
311 314
312 } // namespace download_stats 315 } // namespace download_stats
OLDNEW
« no previous file with comments | « content/browser/download/download_stats.h ('k') | content/browser/renderer_host/x509_user_cert_resource_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698