OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // This file defines a set of user experience metrics data recorded by | 5 // This file defines a set of user experience metrics data recorded by |
6 // the MetricsService. This is the unit of data that is sent to the server. | 6 // the MetricsService. This is the unit of data that is sent to the server. |
7 | 7 |
8 #ifndef COMPONENTS_METRICS_METRICS_LOG_BASE_H_ | 8 #ifndef COMPONENTS_METRICS_METRICS_LOG_BASE_H_ |
9 #define COMPONENTS_METRICS_METRICS_LOG_BASE_H_ | 9 #define COMPONENTS_METRICS_METRICS_LOG_BASE_H_ |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "components/metrics/proto/chrome_user_metrics_extension.pb.h" | 16 #include "components/metrics/proto/chrome_user_metrics_extension.pb.h" |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 class HistogramSamples; | 19 class HistogramSamples; |
20 } // namespace base | 20 } // namespace base |
21 | 21 |
22 namespace metrics { | 22 namespace metrics { |
23 | 23 |
24 // This class provides base functionality for logging metrics data. | 24 // This class provides base functionality for logging metrics data. |
25 class MetricsLogBase { | 25 class MetricsLogBase { |
26 public: | 26 public: |
27 // TODO(asvitkine): Remove the NO_LOG value. | |
28 enum LogType { | 27 enum LogType { |
29 INITIAL_STABILITY_LOG, // The initial log containing stability stats. | 28 INITIAL_STABILITY_LOG, // The initial log containing stability stats. |
30 ONGOING_LOG, // Subsequent logs in a session. | 29 ONGOING_LOG, // Subsequent logs in a session. |
31 NO_LOG, // Placeholder value for when there is no log. | |
32 }; | 30 }; |
33 | 31 |
34 // Creates a new metrics log of the specified type. | 32 // Creates a new metrics log of the specified type. |
35 // client_id is the identifier for this profile on this installation | 33 // client_id is the identifier for this profile on this installation |
36 // session_id is an integer that's incremented on each application launch | 34 // session_id is an integer that's incremented on each application launch |
37 MetricsLogBase(const std::string& client_id, | 35 MetricsLogBase(const std::string& client_id, |
38 int session_id, | 36 int session_id, |
39 LogType log_type, | 37 LogType log_type, |
40 const std::string& version_string); | 38 const std::string& version_string); |
41 virtual ~MetricsLogBase(); | 39 virtual ~MetricsLogBase(); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 94 |
97 // Stores the protocol buffer representation for this log. | 95 // Stores the protocol buffer representation for this log. |
98 metrics::ChromeUserMetricsExtension uma_proto_; | 96 metrics::ChromeUserMetricsExtension uma_proto_; |
99 | 97 |
100 DISALLOW_COPY_AND_ASSIGN(MetricsLogBase); | 98 DISALLOW_COPY_AND_ASSIGN(MetricsLogBase); |
101 }; | 99 }; |
102 | 100 |
103 } // namespace metrics | 101 } // namespace metrics |
104 | 102 |
105 #endif // COMPONENTS_METRICS_METRICS_LOG_BASE_H_ | 103 #endif // COMPONENTS_METRICS_METRICS_LOG_BASE_H_ |
OLD | NEW |