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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_WEBUI_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_UI_CONSTANTS_H_
6 #define CHROME_BROWSER_UI_WEBUI_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_UI_CONSTANTS_H_
8 #include "base/basictypes.h"
10 namespace performance_monitor {
13 EVENT_CATEGORY_EXTENSIONS,
14 EVENT_CATEGORY_CHROME,
15 EVENT_CATEGORY_EXCEPTIONS,
16 EVENT_CATEGORY_NUMBER_OF_CATEGORIES
21 METRIC_CATEGORY_MEMORY,
22 METRIC_CATEGORY_TIMING,
23 METRIC_CATEGORY_NETWORK,
24 METRIC_CATEGORY_NUMBER_OF_CATEGORIES
46 // The different options for aggregation when we pass data to the UI side.
47 enum AggregationMethod {
48 // IMPORTANT! These values are hard-coded in
49 // chrome/browser/resources/performance_monitor.js. Please do not change them.
50 AGGREGATION_METHOD_NONE,
51 AGGREGATION_METHOD_MEDIAN,
52 AGGREGATION_METHOD_MEAN,
53 AGGREGATION_METHOD_NUMBER_OF_METHODS
57 // A MeasurementType represents the "type" of data which we are measuring, e.g.
58 // whether we are measuring distance, memory amounts, time, etc. Two units can
59 // be converted if and only if they are in the same type. We can convert
60 // two units of distance (meters to centimeters), but cannot convert a unit of
61 // time to a unit of memory (seconds to megabytes).
62 enum MeasurementType {
63 MEASUREMENT_TYPE_MEMORY,
64 MEASUREMENT_TYPE_PERCENT,
65 MEASUREMENT_TYPE_TIME,
66 MEASUREMENT_TYPE_UNDEFINED
69 // A struct which holds the conversion information for each unit. The
70 // |amount_in_base_units| corresponds to the value of 1 |unit| in the specified
71 // base for the measurement type (for instance, since the base unit for memory
72 // is bytes, a kilobyte would have |amount_in_base_units| of 1 << 10.
75 const MeasurementType measurement_type;
76 const int64 amount_in_base_units;
79 // Returns the corresponding UnitDetails for the given unit, or NULL if invalid.
80 const UnitDetails* GetUnitDetails(Unit unit);
82 } // namespace performance_monitor
84 #endif // CHROME_BROWSER_UI_WEBUI_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_UI_CONSTANTS_H_