| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 const char kMetricTestStartupTimeUnits[] = "microseconds"; | 51 const char kMetricTestStartupTimeUnits[] = "microseconds"; |
| 52 const double kMetricTestStartupTimeTickSize = 5000000; | 52 const double kMetricTestStartupTimeTickSize = 5000000; |
| 53 | 53 |
| 54 // Session Restore Time | 54 // Session Restore Time |
| 55 const char kMetricSessionRestoreTimeName[] = "Session Restore Time"; | 55 const char kMetricSessionRestoreTimeName[] = "Session Restore Time"; |
| 56 const char kMetricSessionRestoreTimeDescription[] = | 56 const char kMetricSessionRestoreTimeDescription[] = |
| 57 "The session restore time measured in microseconds"; | 57 "The session restore time measured in microseconds"; |
| 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 |
| 62 const char kMetricPageLoadTimeName[] = "Page Load Time"; |
| 63 const char kMetricPageLoadTimeDescription[] = |
| 64 "The amount of time taken to load a page measured in microseconds."; |
| 65 const char kMetricPageLoadTimeUnits[] = "microseconds"; |
| 66 const double kMetricPageLoadTimeTickSize = 30000000.0; |
| 67 |
| 61 // Keep this array synced with MetricTypes in the header file. | 68 // Keep this array synced with MetricTypes in the header file. |
| 62 // TODO(mtytel): i18n. | 69 // TODO(mtytel): i18n. |
| 63 const MetricDetails kMetricDetailsList[] = { | 70 const MetricDetails kMetricDetailsList[] = { |
| 64 { | 71 { |
| 65 kMetricCPUUsageName, | 72 kMetricCPUUsageName, |
| 66 kMetricCPUUsageDescription, | 73 kMetricCPUUsageDescription, |
| 67 kMetricCPUUsageUnits, | 74 kMetricCPUUsageUnits, |
| 68 kMetricCPUUsageTickSize, | 75 kMetricCPUUsageTickSize, |
| 69 }, | 76 }, |
| 70 { | 77 { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 89 kMetricTestStartupTimeName, | 96 kMetricTestStartupTimeName, |
| 90 kMetricTestStartupTimeDescription, | 97 kMetricTestStartupTimeDescription, |
| 91 kMetricTestStartupTimeUnits, | 98 kMetricTestStartupTimeUnits, |
| 92 kMetricTestStartupTimeTickSize | 99 kMetricTestStartupTimeTickSize |
| 93 }, | 100 }, |
| 94 { | 101 { |
| 95 kMetricSessionRestoreTimeName, | 102 kMetricSessionRestoreTimeName, |
| 96 kMetricSessionRestoreTimeDescription, | 103 kMetricSessionRestoreTimeDescription, |
| 97 kMetricSessionRestoreTimeUnits, | 104 kMetricSessionRestoreTimeUnits, |
| 98 kMetricSessionRestoreTimeTickSize | 105 kMetricSessionRestoreTimeTickSize |
| 106 }, |
| 107 { |
| 108 kMetricPageLoadTimeName, |
| 109 kMetricPageLoadTimeDescription, |
| 110 kMetricPageLoadTimeUnits, |
| 111 kMetricPageLoadTimeTickSize |
| 99 } | 112 } |
| 100 }; | 113 }; |
| 101 COMPILE_ASSERT(ARRAYSIZE_UNSAFE(kMetricDetailsList) == METRIC_NUMBER_OF_METRICS, | 114 COMPILE_ASSERT(ARRAYSIZE_UNSAFE(kMetricDetailsList) == METRIC_NUMBER_OF_METRICS, |
| 102 metric_names_incorrect_size); | 115 metric_names_incorrect_size); |
| 103 | 116 |
| 104 } // namespace | 117 } // namespace |
| 105 | 118 |
| 106 const MetricDetails* GetMetricDetails(MetricType metric_type) { | 119 const MetricDetails* GetMetricDetails(MetricType metric_type) { |
| 107 DCHECK_GT(METRIC_NUMBER_OF_METRICS, metric_type); | 120 DCHECK_GT(METRIC_NUMBER_OF_METRICS, metric_type); |
| 108 return &kMetricDetailsList[metric_type]; | 121 return &kMetricDetailsList[metric_type]; |
| 109 } | 122 } |
| 110 | 123 |
| 111 } // namespace performance_monitor | 124 } // namespace performance_monitor |
| OLD | NEW |