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

Unified Diff: chrome/browser/performance_monitor/metric.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: Estade's requests 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/metric.h
diff --git a/chrome/browser/performance_monitor/metric.h b/chrome/browser/performance_monitor/metric.h
index 76e8ded8d814ad2b38fdf90daa6780a84e35745a..79b9ed7c75e644180a774374408c6e875e86fc8a 100644
--- a/chrome/browser/performance_monitor/metric.h
+++ b/chrome/browser/performance_monitor/metric.h
@@ -32,10 +32,25 @@ METRIC_NUMBER_OF_METRICS
struct Metric {
public:
Metric();
- Metric(const base::Time& metric_time, const double metric_value);
- Metric(const std::string& metric_time, const std::string& metric_value);
+ Metric(MetricType metric_type,
+ const base::Time& metric_time,
+ const double metric_value);
+ Metric(MetricType metric_type,
+ const std::string& metric_time,
+ const std::string& metric_value);
~Metric();
+ // Check the value in the metric to make sure that it is reasonable. Since
+ // some metric-gathering methods will fail and return incorrect values, we
+ // need to try to weed these out as best we can.
+ bool IsValid() const;
+
+ // This converts the double stored in value to a string format. This will
+ // not perform any checking on the validity of the metric, and only makes
+ // sense if the metric IsValid().
+ std::string ValueAsString() const;
+
+ MetricType type;
base::Time time;
double value;
};
« no previous file with comments | « chrome/browser/performance_monitor/database_unittest.cc ('k') | chrome/browser/performance_monitor/metric.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698