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

Unified Diff: chrome/browser/performance_monitor/constants.h

Issue 10907121: Add guards to metric values; erase bad events/metrics from db (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_use_units
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/performance_monitor/constants.h
diff --git a/chrome/browser/performance_monitor/constants.h b/chrome/browser/performance_monitor/constants.h
index 84681f9cc1315886a6ce0ecade79fbf05d3c5f26..edad421da78d98b2bb983adefbc0ca15d6d3906b 100644
--- a/chrome/browser/performance_monitor/constants.h
+++ b/chrome/browser/performance_monitor/constants.h
@@ -5,6 +5,9 @@
#ifndef CHROME_BROWSER_PERFORMANCE_MONITOR_CONSTANTS_H_
#define CHROME_BROWSER_PERFORMANCE_MONITOR_CONSTANTS_H_
+#include "base/basictypes.h"
+#include "base/time.h"
+
namespace performance_monitor {
// Constants which are used by the PerformanceMonitor and its related classes.
@@ -19,6 +22,21 @@ extern const int kDefaultGatherIntervalInSeconds;
extern const char kStateChromeVersion[];
extern const char kStateProfilePrefix[];
+// Unit values (for use in metric, and on the UI side).
+
+// Memory measurements
+const int64 kBytesPerKilobyte = 1 << 10;
Evan Stade 2012/09/14 08:39:16 define in cc
Devlin 2012/09/17 16:35:59 Done.
+const int64 kBytesPerMegabyte = kBytesPerKilobyte * (1 << 10);
+const int64 kBytesPerGigabyte = kBytesPerMegabyte * (1 << 10);
+const int64 kBytesPerTerabyte = kBytesPerGigabyte * (1 << 10);
+
+// Time measurements - Most of these are imported from base/time.h
+// These units are used for display (and it's related calculations), not for
+// any mathematical analysis. Thus we can estimate for values without an exact
+// conversion.
+const int64 kMicrosecondsPerMonth = base::Time::kMicrosecondsPerDay * 30;
+const int64 kMicrosecondsPerYear = base::Time::kMicrosecondsPerDay * 365;
+
} // namespace performance_monitor
#endif // CHROME_BROWSER_PERFORMANCE_MONITOR_CONSTANTS_H_

Powered by Google App Engine
This is Rietveld 408576698