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_CONSTANTS_H_ | 5 #ifndef CHROME_BROWSER_PERFORMANCE_MONITOR_CONSTANTS_H_ |
6 #define CHROME_BROWSER_PERFORMANCE_MONITOR_CONSTANTS_H_ | 6 #define CHROME_BROWSER_PERFORMANCE_MONITOR_CONSTANTS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 | 10 |
11 namespace performance_monitor { | 11 namespace performance_monitor { |
12 | 12 |
13 // Constants which are used by the PerformanceMonitor and its related classes. | 13 // Constants which are used by the PerformanceMonitor and its related classes. |
14 // The constants should be documented alongside the definition of their values | 14 // The constants should be documented alongside the definition of their values |
15 // in the .cc file. | 15 // in the .cc file. |
16 | 16 |
17 extern const char kMetricNotFoundError[]; | 17 extern const char kMetricNotFoundError[]; |
18 extern const char kProcessChromeAggregate[]; | 18 extern const char kProcessChromeAggregate[]; |
19 | 19 |
20 // State tokens | 20 // State tokens |
21 extern const char kStateChromeVersion[]; | 21 extern const char kStateChromeVersion[]; |
22 extern const char kStateProfilePrefix[]; | 22 extern const char kStateProfilePrefix[]; |
23 | 23 |
| 24 // The interval the watched processes are sampled for performance metrics. |
| 25 const int kSampleIntervalInSeconds = 10; |
24 // The default interval at which PerformanceMonitor performs its timed | 26 // The default interval at which PerformanceMonitor performs its timed |
25 // collections; this can be overridden by using the kPerformanceMonitorGathering | 27 // collections; this can be overridden by using the kPerformanceMonitorGathering |
26 // switch with an associated (positive integer) value. | 28 // switch with an associated (positive integer) value. |
27 const int kDefaultGatherIntervalInSeconds = 120; | 29 const int kDefaultGatherIntervalInSeconds = 120; |
28 | 30 |
29 // Unit values (for use in metric, and on the UI side). | 31 // Unit values (for use in metric, and on the UI side). |
30 | 32 |
31 // Memory measurements | 33 // Memory measurements |
32 const int64 kBytesPerKilobyte = 1 << 10; | 34 const int64 kBytesPerKilobyte = 1 << 10; |
33 const int64 kBytesPerMegabyte = kBytesPerKilobyte * (1 << 10); | 35 const int64 kBytesPerMegabyte = kBytesPerKilobyte * (1 << 10); |
34 const int64 kBytesPerGigabyte = kBytesPerMegabyte * (1 << 10); | 36 const int64 kBytesPerGigabyte = kBytesPerMegabyte * (1 << 10); |
35 const int64 kBytesPerTerabyte = kBytesPerGigabyte * (1 << 10); | 37 const int64 kBytesPerTerabyte = kBytesPerGigabyte * (1 << 10); |
36 | 38 |
37 // Time measurements - Most of these are imported from base/time/time.h | 39 // Time measurements - Most of these are imported from base/time/time.h |
38 // These units are used for display (and it's related calculations), not for | 40 // These units are used for display (and it's related calculations), not for |
39 // any mathematical analysis. Thus we can estimate for values without an exact | 41 // any mathematical analysis. Thus we can estimate for values without an exact |
40 // conversion. | 42 // conversion. |
41 const int64 kMicrosecondsPerMonth = base::Time::kMicrosecondsPerDay * 30; | 43 const int64 kMicrosecondsPerMonth = base::Time::kMicrosecondsPerDay * 30; |
42 const int64 kMicrosecondsPerYear = base::Time::kMicrosecondsPerDay * 365; | 44 const int64 kMicrosecondsPerYear = base::Time::kMicrosecondsPerDay * 365; |
43 | 45 |
| 46 // Performance alert thresholds |
| 47 |
| 48 // If a process is consistently above this CPU utilization percentage over time, |
| 49 // we consider it as high and may take action. |
| 50 const float kHighCPUUtilizationThreshold = 90.0f; |
44 } // namespace performance_monitor | 51 } // namespace performance_monitor |
45 | 52 |
46 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_CONSTANTS_H_ | 53 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_CONSTANTS_H_ |
OLD | NEW |