Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_PERFORMANCE_MONITOR_METRIC_H_ | 5 #ifndef CHROME_BROWSER_PERFORMANCE_MONITOR_METRIC_H_ |
| 6 #define CHROME_BROWSER_PERFORMANCE_MONITOR_METRIC_H_ | 6 #define CHROME_BROWSER_PERFORMANCE_MONITOR_METRIC_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 | 10 |
| 11 namespace performance_monitor { | 11 namespace performance_monitor { |
| 12 | 12 |
| 13 // IMPORTANT: To add new metrics, please | 13 // IMPORTANT: To add new metrics, please |
| 14 // - Place the new metric above METRIC_NUMBER_OF_METRICS. | 14 // - Place the new metric above METRIC_NUMBER_OF_METRICS. |
| 15 // - Add a member to the MetricKeyChar enum in key_builder.cc. | 15 // - Add a member to the MetricKeyChar enum in key_builder.cc. |
| 16 // - Add the appropriate messages in generated_resources.grd. | 16 // - Add the appropriate messages in generated_resources.grd. |
| 17 // - Add the appropriate functions in | 17 // - Add the appropriate functions in |
| 18 // chrome/browser/ui/webui/performance_monitor/performance_monitor_l10n.h. | 18 // chrome/browser/ui/webui/performance_monitor/performance_monitor_l10n.h. |
| 19 enum MetricType { | 19 enum MetricType { |
| 20 METRIC_UNDEFINED, | 20 // Used only to indicate invalid metrics and to generate database keys. |
|
Yoyo Zhou
2012/09/27 19:18:27
ditto
Devlin
2012/09/28 02:33:23
Done.
| |
| 21 METRIC_CPU_USAGE, | 21 METRIC_UNDEFINED, |
| 22 METRIC_PRIVATE_MEMORY_USAGE, | 22 |
| 23 METRIC_SHARED_MEMORY_USAGE, | 23 // CPU and memory usage are combined for all Chrome-related processes. |
| 24 METRIC_STARTUP_TIME, | 24 METRIC_CPU_USAGE, |
| 25 METRIC_TEST_STARTUP_TIME, | 25 METRIC_PRIVATE_MEMORY_USAGE, |
| 26 METRIC_SESSION_RESTORE_TIME, | 26 METRIC_SHARED_MEMORY_USAGE, |
| 27 METRIC_PAGE_LOAD_TIME, | 27 |
| 28 METRIC_NETWORK_BYTES_READ, | 28 // Timing measurements; these are all independent metrics (e.g., session |
| 29 METRIC_NUMBER_OF_METRICS | 29 // restore time is independent of startup time, even though they may happen |
| 30 // in sequence). Test startup time refers to startup times which are not the | |
|
Yoyo Zhou
2012/09/27 19:18:27
I'd write "refers to non-normal startups, e.g."
Devlin
2012/09/28 02:33:23
Done.
| |
| 31 // norm, e.g. when we run test suites. | |
| 32 METRIC_STARTUP_TIME, | |
| 33 METRIC_TEST_STARTUP_TIME, | |
| 34 METRIC_SESSION_RESTORE_TIME, | |
| 35 METRIC_PAGE_LOAD_TIME, | |
| 36 | |
| 37 // Total number of bytes read since PerformanceMonitor first started running. | |
| 38 METRIC_NETWORK_BYTES_READ, | |
| 39 | |
| 40 // Used only to indicate the number of metrics (including the undefined type) | |
|
Yoyo Zhou
2012/09/27 19:18:27
ditto
Devlin
2012/09/28 02:33:23
Done.
| |
| 41 // and to generate database keys. | |
| 42 METRIC_NUMBER_OF_METRICS | |
| 30 }; | 43 }; |
| 31 | 44 |
| 32 struct Metric { | 45 struct Metric { |
| 33 public: | 46 public: |
| 34 Metric(); | 47 Metric(); |
| 35 Metric(const base::Time& metric_time, const double metric_value); | 48 Metric(const base::Time& metric_time, const double metric_value); |
| 36 Metric(const std::string& metric_time, const std::string& metric_value); | 49 Metric(const std::string& metric_time, const std::string& metric_value); |
| 37 ~Metric(); | 50 ~Metric(); |
| 38 | 51 |
| 39 base::Time time; | 52 base::Time time; |
| 40 double value; | 53 double value; |
| 41 }; | 54 }; |
| 42 | 55 |
| 43 } // namespace performance_monitor | 56 } // namespace performance_monitor |
| 44 | 57 |
| 45 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_METRIC_H_ | 58 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_METRIC_H_ |
| OLD | NEW |