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_METRIC_H_ | 5 #ifndef CHROME_BROWSER_PERFORMANCE_MONITOR_METRIC_H_ |
6 #define CHROME_BROWSER_PERFORMANCE_MONITOR_METRIC_H_ | 6 #define CHROME_BROWSER_PERFORMANCE_MONITOR_METRIC_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... | |
25 METRIC_TEST_STARTUP_TIME, | 25 METRIC_TEST_STARTUP_TIME, |
26 METRIC_SESSION_RESTORE_TIME, | 26 METRIC_SESSION_RESTORE_TIME, |
27 METRIC_PAGE_LOAD_TIME, | 27 METRIC_PAGE_LOAD_TIME, |
28 METRIC_NETWORK_BYTES_READ, | 28 METRIC_NETWORK_BYTES_READ, |
29 METRIC_NUMBER_OF_METRICS | 29 METRIC_NUMBER_OF_METRICS |
30 }; | 30 }; |
31 | 31 |
32 struct Metric { | 32 struct Metric { |
33 public: | 33 public: |
34 Metric(); | 34 Metric(); |
35 Metric(const base::Time& metric_time, const double metric_value); | 35 Metric(MetricType metric_type, |
36 Metric(const std::string& metric_time, const std::string& metric_value); | 36 const base::Time& metric_time, |
37 const double metric_value); | |
38 Metric(MetricType metric_type, | |
39 const std::string& metric_time, | |
40 const std::string& metric_value); | |
37 ~Metric(); | 41 ~Metric(); |
38 | 42 |
43 // Check the value in the metric to make sure that it is reasonable. Since | |
44 // some metric-gathering methods will fail and return incorrect values, we | |
45 // need to try to weed these out as best we can. | |
46 bool Validate() const; | |
Yoyo Zhou
2012/09/10 23:52:44
This should be called something like IsValid.
Devlin
2012/09/11 18:52:17
Done.
| |
47 | |
48 std::string ValueAsString() const; | |
Yoyo Zhou
2012/09/10 23:52:44
Does this make sense if the metric isn't valid? If
Devlin
2012/09/11 18:52:17
Done.
Yoyo Zhou
2012/09/13 00:09:20
I was hoping more for something like, "This only m
Devlin
2012/09/13 17:00:24
Done.
| |
49 | |
50 MetricType type; | |
39 base::Time time; | 51 base::Time time; |
40 double value; | 52 double value; |
41 }; | 53 }; |
42 | 54 |
43 } // namespace performance_monitor | 55 } // namespace performance_monitor |
44 | 56 |
45 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_METRIC_H_ | 57 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_METRIC_H_ |
OLD | NEW |