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

Side by Side Diff: chrome/browser/performance_monitor/metric_details.cc

Issue 10829342: Add BytesRead metric to CPM (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Requested changes + separation for disk/network reads Created 8 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 (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 "chrome/browser/performance_monitor/metric_details.h" 5 #include "chrome/browser/performance_monitor/metric_details.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/performance_monitor/constants.h" 8 #include "chrome/browser/performance_monitor/constants.h"
9 9
10 namespace performance_monitor { 10 namespace performance_monitor {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 const char kMetricSessionRestoreTimeUnits[] = "microseconds"; 58 const char kMetricSessionRestoreTimeUnits[] = "microseconds";
59 const double kMetricSessionRestoreTimeTickSize = 5000000; 59 const double kMetricSessionRestoreTimeTickSize = 5000000;
60 60
61 // Page Load Time 61 // Page Load Time
62 const char kMetricPageLoadTimeName[] = "Page Load Time"; 62 const char kMetricPageLoadTimeName[] = "Page Load Time";
63 const char kMetricPageLoadTimeDescription[] = 63 const char kMetricPageLoadTimeDescription[] =
64 "The amount of time taken to load a page measured in microseconds."; 64 "The amount of time taken to load a page measured in microseconds.";
65 const char kMetricPageLoadTimeUnits[] = "microseconds"; 65 const char kMetricPageLoadTimeUnits[] = "microseconds";
66 const double kMetricPageLoadTimeTickSize = 30000000.0; 66 const double kMetricPageLoadTimeTickSize = 30000000.0;
67 67
68 // Bytes Read
69 const char kMetricDiskBytesReadName[] = "Disk Bytes Read";
70 const char kMetricDiskBytesReadDescription[] =
71 "The number of bytes read from the disk.";
72 const char kMetricDiskBytesReadUnits[] = "bytes";
73 const double kMetricDiskBytesReadTickSize = 2000000.0;
74
75 // Bytes Read
76 const char kMetricNetworkBytesReadName[] = "Network Bytes Read";
77 const char kMetricNetworkBytesReadDescription[] =
78 "The number of bytes read across the network.";
79 const char kMetricNetworkBytesReadUnits[] = "bytes";
80 const double kMetricNetworkBytesReadTickSize = 2000000.0;
81
68 // Keep this array synced with MetricTypes in the header file. 82 // Keep this array synced with MetricTypes in the header file.
69 // TODO(mtytel): i18n. 83 // TODO(mtytel): i18n.
70 const MetricDetails kMetricDetailsList[] = { 84 const MetricDetails kMetricDetailsList[] = {
71 { 85 {
72 kMetricCPUUsageName, 86 kMetricCPUUsageName,
73 kMetricCPUUsageDescription, 87 kMetricCPUUsageDescription,
74 kMetricCPUUsageUnits, 88 kMetricCPUUsageUnits,
75 kMetricCPUUsageTickSize, 89 kMetricCPUUsageTickSize,
76 }, 90 },
77 { 91 {
(...skipping 24 matching lines...) Expand all
102 kMetricSessionRestoreTimeName, 116 kMetricSessionRestoreTimeName,
103 kMetricSessionRestoreTimeDescription, 117 kMetricSessionRestoreTimeDescription,
104 kMetricSessionRestoreTimeUnits, 118 kMetricSessionRestoreTimeUnits,
105 kMetricSessionRestoreTimeTickSize 119 kMetricSessionRestoreTimeTickSize
106 }, 120 },
107 { 121 {
108 kMetricPageLoadTimeName, 122 kMetricPageLoadTimeName,
109 kMetricPageLoadTimeDescription, 123 kMetricPageLoadTimeDescription,
110 kMetricPageLoadTimeUnits, 124 kMetricPageLoadTimeUnits,
111 kMetricPageLoadTimeTickSize 125 kMetricPageLoadTimeTickSize
126 },
127 {
128 kMetricDiskBytesReadName,
129 kMetricDiskBytesReadDescription,
130 kMetricDiskBytesReadUnits,
131 kMetricDiskBytesReadTickSize
132 },
133 {
134 kMetricNetworkBytesReadName,
135 kMetricNetworkBytesReadDescription,
136 kMetricNetworkBytesReadUnits,
137 kMetricNetworkBytesReadTickSize
112 } 138 }
113 }; 139 };
114 COMPILE_ASSERT(ARRAYSIZE_UNSAFE(kMetricDetailsList) == METRIC_NUMBER_OF_METRICS, 140 COMPILE_ASSERT(ARRAYSIZE_UNSAFE(kMetricDetailsList) == METRIC_NUMBER_OF_METRICS,
115 metric_names_incorrect_size); 141 metric_names_incorrect_size);
116 142
117 } // namespace 143 } // namespace
118 144
119 const MetricDetails* GetMetricDetails(MetricType metric_type) { 145 const MetricDetails* GetMetricDetails(MetricType metric_type) {
120 DCHECK_GT(METRIC_NUMBER_OF_METRICS, metric_type); 146 DCHECK_GT(METRIC_NUMBER_OF_METRICS, metric_type);
121 return &kMetricDetailsList[metric_type]; 147 return &kMetricDetailsList[metric_type];
122 } 148 }
123 149
124 } // namespace performance_monitor 150 } // namespace performance_monitor
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698