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

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

Issue 2789623005: Add UMA metric to track parallel download requests stats. (Closed)
Patch Set: Work on feedback. Created 3 years, 8 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 (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/macros.h" 7 #include "base/macros.h"
8 #include "base/metrics/histogram_functions.h" 8 #include "base/metrics/histogram_functions.h"
9 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "base/metrics/sparse_histogram.h" 10 #include "base/metrics/sparse_histogram.h"
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 RecordBandwidthMetric( 766 RecordBandwidthMetric(
767 "Download.BandwidthDiskBytesPerSecond", 767 "Download.BandwidthDiskBytesPerSecond",
768 CalculateBandwidthBytesPerSecond(length, disk_write_time)); 768 CalculateBandwidthBytesPerSecond(length, disk_write_time));
769 } 769 }
770 770
771 void RecordParallelDownloadCount(DownloadCountTypes type) { 771 void RecordParallelDownloadCount(DownloadCountTypes type) {
772 UMA_HISTOGRAM_ENUMERATION("Download.Counts.ParallelDownload", type, 772 UMA_HISTOGRAM_ENUMERATION("Download.Counts.ParallelDownload", type,
773 DOWNLOAD_COUNT_TYPES_LAST_ENTRY); 773 DOWNLOAD_COUNT_TYPES_LAST_ENTRY);
774 } 774 }
775 775
776 void RecordParallelDownloadRequestCount(int request_count) {
777 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.ParallelDownloadRequestCount",
778 request_count, 1, 10, 11);
779 }
780
781 void RecordParallelDownloadAddStreamSuccess(bool success) {
782 UMA_HISTOGRAM_BOOLEAN("Download.ParallelDownloadAddStreamSuccess", success);
783 }
784
776 void RecordParallelDownloadStats( 785 void RecordParallelDownloadStats(
777 size_t bytes_downloaded_with_parallel_streams, 786 size_t bytes_downloaded_with_parallel_streams,
778 base::TimeDelta time_with_parallel_streams, 787 base::TimeDelta time_with_parallel_streams,
779 size_t bytes_downloaded_without_parallel_streams, 788 size_t bytes_downloaded_without_parallel_streams,
780 base::TimeDelta time_without_parallel_streams) { 789 base::TimeDelta time_without_parallel_streams) {
781 int bandwidth_without_parallel_streams = CalculateBandwidthBytesPerSecond( 790 int bandwidth_without_parallel_streams = CalculateBandwidthBytesPerSecond(
782 bytes_downloaded_without_parallel_streams, time_without_parallel_streams); 791 bytes_downloaded_without_parallel_streams, time_without_parallel_streams);
783 RecordBandwidthMetric( 792 RecordBandwidthMetric(
784 "Download.BandwidthWithoutParallelStreamsBytesPerSecond", 793 "Download.BandwidthWithoutParallelStreamsBytesPerSecond",
785 bandwidth_without_parallel_streams); 794 bandwidth_without_parallel_streams);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 if (!page_transition) 894 if (!page_transition)
886 return; 895 return;
887 896
888 UMA_HISTOGRAM_ENUMERATION( 897 UMA_HISTOGRAM_ENUMERATION(
889 "Download.PageTransition", 898 "Download.PageTransition",
890 ui::PageTransitionStripQualifier(page_transition.value()), 899 ui::PageTransitionStripQualifier(page_transition.value()),
891 ui::PAGE_TRANSITION_LAST_CORE + 1); 900 ui::PAGE_TRANSITION_LAST_CORE + 1);
892 } 901 }
893 902
894 } // namespace content 903 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_stats.h ('k') | content/browser/download/parallel_download_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698