Home | History | Annotate | Download | only in performance_monitor
      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.
      4 
      5 #ifndef CHROME_BROWSER_PERFORMANCE_MONITOR_CONSTANTS_H_
      6 #define CHROME_BROWSER_PERFORMANCE_MONITOR_CONSTANTS_H_
      7 
      8 #include "base/basictypes.h"
      9 #include "base/time/time.h"
     10 
     11 namespace performance_monitor {
     12 
     13 // Constants which are used by the PerformanceMonitor and its related classes.
     14 // The constants should be documented alongside the definition of their values
     15 // in the .cc file.
     16 
     17 extern const char kMetricNotFoundError[];
     18 extern const char kProcessChromeAggregate[];
     19 
     20 // State tokens
     21 extern const char kStateChromeVersion[];
     22 extern const char kStateProfilePrefix[];
     23 
     24 // The default interval at which PerformanceMonitor performs its timed
     25 // collections; this can be overridden by using the kPerformanceMonitorGathering
     26 // switch with an associated (positive integer) value.
     27 const int kDefaultGatherIntervalInSeconds = 120;
     28 
     29 // Unit values (for use in metric, and on the UI side).
     30 
     31 // Memory measurements
     32 const int64 kBytesPerKilobyte = 1 << 10;
     33 const int64 kBytesPerMegabyte = kBytesPerKilobyte * (1 << 10);
     34 const int64 kBytesPerGigabyte = kBytesPerMegabyte * (1 << 10);
     35 const int64 kBytesPerTerabyte = kBytesPerGigabyte * (1 << 10);
     36 
     37 // 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
     39 // any mathematical analysis. Thus we can estimate for values without an exact
     40 // conversion.
     41 const int64 kMicrosecondsPerMonth = base::Time::kMicrosecondsPerDay * 30;
     42 const int64 kMicrosecondsPerYear = base::Time::kMicrosecondsPerDay * 365;
     43 
     44 }  // namespace performance_monitor
     45 
     46 #endif  // CHROME_BROWSER_PERFORMANCE_MONITOR_CONSTANTS_H_
     47