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

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

Issue 10656052: Performance monitor stats gathering. (Closed) Base URL: http://git.chromium.org/chromium/src.git@cpm_main
Patch Set: Nits Created 8 years, 5 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 {
11 namespace { 11 namespace {
12 12
13 // Keep this array synced with MetricTypes in the header file. 13 // Keep this array synced with MetricTypes in the header file.
14 // TODO(mtytel): i18n. 14 // TODO(mtytel): i18n.
15 const char* kMetricTypeNames[] = { 15 const char* kMetricTypeNames[] = {
16 kSampleMetricName 16 kMetricCPUUsage,
17 kMetricPrivateMemoryUsage,
18 kMetricSharedMemoryUsage
17 }; 19 };
18 COMPILE_ASSERT(ARRAYSIZE_UNSAFE(kMetricTypeNames) == METRIC_NUMBER_OF_METRICS, 20 COMPILE_ASSERT(ARRAYSIZE_UNSAFE(kMetricTypeNames) == METRIC_NUMBER_OF_METRICS,
19 metric_names_incorrect_size); 21 metric_names_incorrect_size);
20 22
21 } // namespace 23 } // namespace
22 24
23 const char* MetricTypeToString(MetricType metric_type) { 25 const char* MetricTypeToString(MetricType metric_type) {
24 DCHECK_GT(METRIC_NUMBER_OF_METRICS, metric_type); 26 DCHECK_GT(METRIC_NUMBER_OF_METRICS, metric_type);
25 return kMetricTypeNames[metric_type]; 27 return kMetricTypeNames[metric_type];
26 } 28 }
27 29
28 MetricDetails::MetricDetails() { 30 MetricDetails::MetricDetails() {
29 } 31 }
30 32
31 MetricDetails::MetricDetails(const std::string& metric_name, 33 MetricDetails::MetricDetails(const std::string& metric_name,
32 const std::string& metric_description) 34 const std::string& metric_description)
33 : name(metric_name), 35 : name(metric_name),
34 description(metric_description) { 36 description(metric_description) {
35 } 37 }
36 38
37 MetricDetails::~MetricDetails() { 39 MetricDetails::~MetricDetails() {
38 } 40 }
39 41
40 } // namespace performance_monitor 42 } // namespace performance_monitor
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698