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

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

Issue 10855109: Fix static initialization in CPM Metric Details (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Or...we could do this the easy way 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
« no previous file with comments | « chrome/browser/performance_monitor/constants.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
11 namespace { 11 namespace {
12 12
13 // Metric details follow.
14 // All metric details have the following constants:
15 // - Name
16 // - Description
17 // - Units
18 // - TickSize (the smallest possible maximum which will be viewed in the ui.)
19
20 // CPU Usage
21 const char kMetricCPUUsageName[] = "CPU Usage";
22 const char kMetricCPUUsageDescription[] = "The CPU usage measured in percent.";
23 const char kMetricCPUUsageUnits[] = "percent";
24 const double kMetricCPUUsageTickSize = 100.0;
25
26 // Private Memory Usage
27 const char kMetricPrivateMemoryUsageName[] = "Private Memory Usage";
28 const char kMetricPrivateMemoryUsageDescription[] =
29 "The total private memory usage of all chrome processes measured in bytes.";
30 const char kMetricPrivateMemoryUsageUnits[] = "bytes";
31 const double kMetricPrivateMemoryUsageTickSize = 10000000.0;
32
33 // Shared Memory Usage
34 const char kMetricSharedMemoryUsageName[] = "Shared Memory Usage";
35 const char kMetricSharedMemoryUsageDescription[] =
36 "The total shared memory usage of all chrome processes measured in bytes.";
37 const char kMetricSharedMemoryUsageUnits[] = "bytes";
38 const double kMetricSharedMemoryUsageTickSize = 10000000.0;
39
40 // Startup Time
41 const char kMetricStartupTimeName[] = "Startup Time";
42 const char kMetricStartupTimeDescription[] =
43 "The startup time measured in microseconds";
44 const char kMetricStartupTimeUnits[] = "microseconds";
45 const double kMetricStartupTimeTickSize = 5000000;
46
47 // Test Startup Time
48 const char kMetricTestStartupTimeName[] = "Test Startup Time";
49 const char kMetricTestStartupTimeDescription[] =
50 "The startup time of test startups measured in microseconds";
51 const char kMetricTestStartupTimeUnits[] = "microseconds";
52 const double kMetricTestStartupTimeTickSize = 5000000;
53
54 // Session Restore Time
55 const char kMetricSessionRestoreTimeName[] = "Session Restore Time";
56 const char kMetricSessionRestoreTimeDescription[] =
57 "The session restore time measured in microseconds";
58 const char kMetricSessionRestoreTimeUnits[] = "microseconds";
59 const double kMetricSessionRestoreTimeTickSize = 5000000;
60
13 // Keep this array synced with MetricTypes in the header file. 61 // Keep this array synced with MetricTypes in the header file.
14 // TODO(mtytel): i18n. 62 // TODO(mtytel): i18n.
15 const MetricDetails kMetricDetailsList[] = { 63 const MetricDetails kMetricDetailsList[] = {
16 { 64 {
17 kMetricCPUUsageName, 65 kMetricCPUUsageName,
18 kMetricCPUUsageDescription, 66 kMetricCPUUsageDescription,
19 kMetricCPUUsageUnits, 67 kMetricCPUUsageUnits,
20 kMetricCPUUsageTickSize, 68 kMetricCPUUsageTickSize,
21 }, 69 },
22 { 70 {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 metric_names_incorrect_size); 102 metric_names_incorrect_size);
55 103
56 } // namespace 104 } // namespace
57 105
58 const MetricDetails* GetMetricDetails(MetricType metric_type) { 106 const MetricDetails* GetMetricDetails(MetricType metric_type) {
59 DCHECK_GT(METRIC_NUMBER_OF_METRICS, metric_type); 107 DCHECK_GT(METRIC_NUMBER_OF_METRICS, metric_type);
60 return &kMetricDetailsList[metric_type]; 108 return &kMetricDetailsList[metric_type];
61 } 109 }
62 110
63 } // namespace performance_monitor 111 } // namespace performance_monitor
OLDNEW
« no previous file with comments | « chrome/browser/performance_monitor/constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698