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_PERFORMANCE_MONITOR_CONSTANTS_H_
6 #define CHROME_BROWSER_PERFORMANCE_MONITOR_CONSTANTS_H_
8 #include "base/basictypes.h"
9 #include "base/time/time.h"
11 namespace performance_monitor
{
13 // Constants which are used by the PerformanceMonitor and its related classes.
14 // The constants should be documented alongside the definition of their values
17 extern const char kMetricNotFoundError
[];
18 extern const char kProcessChromeAggregate
[];
21 extern const char kStateChromeVersion
[];
22 extern const char kStateProfilePrefix
[];
24 // The interval the watched processes are sampled for performance metrics.
25 const int kSampleIntervalInSeconds
= 10;
26 // The default interval at which PerformanceMonitor performs its timed
27 // collections; this can be overridden by using the kPerformanceMonitorGathering
28 // switch with an associated (positive integer) value.
29 const int kDefaultGatherIntervalInSeconds
= 120;
31 // Unit values (for use in metric, and on the UI side).
33 // Memory measurements
34 const int64 kBytesPerKilobyte
= 1 << 10;
35 const int64 kBytesPerMegabyte
= kBytesPerKilobyte
* (1 << 10);
36 const int64 kBytesPerGigabyte
= kBytesPerMegabyte
* (1 << 10);
37 const int64 kBytesPerTerabyte
= kBytesPerGigabyte
* (1 << 10);
39 // Time measurements - Most of these are imported from base/time/time.h
40 // These units are used for display (and it's related calculations), not for
41 // any mathematical analysis. Thus we can estimate for values without an exact
43 const int64 kMicrosecondsPerMonth
= base::Time::kMicrosecondsPerDay
* 30;
44 const int64 kMicrosecondsPerYear
= base::Time::kMicrosecondsPerDay
* 365;
46 // Performance alert thresholds
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
;
51 } // namespace performance_monitor
53 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_CONSTANTS_H_