OLD | NEW |
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 Loading... |
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 // Network Bytes Read |
| 69 const char kMetricNetworkBytesReadName[] = "Network Bytes Read"; |
| 70 const char kMetricNetworkBytesReadDescription[] = |
| 71 "The number of bytes read across the network."; |
| 72 const char kMetricNetworkBytesReadUnits[] = "bytes"; |
| 73 const double kMetricNetworkBytesReadTickSize = 2000000.0; |
| 74 |
68 // Keep this array synced with MetricTypes in the header file. | 75 // Keep this array synced with MetricTypes in the header file. |
69 // TODO(mtytel): i18n. | 76 // TODO(mtytel): i18n. |
70 const MetricDetails kMetricDetailsList[] = { | 77 const MetricDetails kMetricDetailsList[] = { |
71 { | 78 { |
72 kMetricCPUUsageName, | 79 kMetricCPUUsageName, |
73 kMetricCPUUsageDescription, | 80 kMetricCPUUsageDescription, |
74 kMetricCPUUsageUnits, | 81 kMetricCPUUsageUnits, |
75 kMetricCPUUsageTickSize, | 82 kMetricCPUUsageTickSize, |
76 }, | 83 }, |
77 { | 84 { |
(...skipping 24 matching lines...) Expand all Loading... |
102 kMetricSessionRestoreTimeName, | 109 kMetricSessionRestoreTimeName, |
103 kMetricSessionRestoreTimeDescription, | 110 kMetricSessionRestoreTimeDescription, |
104 kMetricSessionRestoreTimeUnits, | 111 kMetricSessionRestoreTimeUnits, |
105 kMetricSessionRestoreTimeTickSize | 112 kMetricSessionRestoreTimeTickSize |
106 }, | 113 }, |
107 { | 114 { |
108 kMetricPageLoadTimeName, | 115 kMetricPageLoadTimeName, |
109 kMetricPageLoadTimeDescription, | 116 kMetricPageLoadTimeDescription, |
110 kMetricPageLoadTimeUnits, | 117 kMetricPageLoadTimeUnits, |
111 kMetricPageLoadTimeTickSize | 118 kMetricPageLoadTimeTickSize |
| 119 }, |
| 120 { |
| 121 kMetricNetworkBytesReadName, |
| 122 kMetricNetworkBytesReadDescription, |
| 123 kMetricNetworkBytesReadUnits, |
| 124 kMetricNetworkBytesReadTickSize |
112 } | 125 } |
113 }; | 126 }; |
114 COMPILE_ASSERT(ARRAYSIZE_UNSAFE(kMetricDetailsList) == METRIC_NUMBER_OF_METRICS, | 127 COMPILE_ASSERT(ARRAYSIZE_UNSAFE(kMetricDetailsList) == METRIC_NUMBER_OF_METRICS, |
115 metric_names_incorrect_size); | 128 metric_names_incorrect_size); |
116 | 129 |
117 } // namespace | 130 } // namespace |
118 | 131 |
119 const MetricDetails* GetMetricDetails(MetricType metric_type) { | 132 const MetricDetails* GetMetricDetails(MetricType metric_type) { |
120 DCHECK_GT(METRIC_NUMBER_OF_METRICS, metric_type); | 133 DCHECK_GT(METRIC_NUMBER_OF_METRICS, metric_type); |
121 return &kMetricDetailsList[metric_type]; | 134 return &kMetricDetailsList[metric_type]; |
122 } | 135 } |
123 | 136 |
124 } // namespace performance_monitor | 137 } // namespace performance_monitor |
OLD | NEW |