OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 METRICS_LIBRARY_H_ | 5 #ifndef METRICS_LIBRARY_H_ |
6 #define METRICS_LIBRARY_H_ | 6 #define METRICS_LIBRARY_H_ |
7 | 7 |
8 #include <sys/types.h> | 8 #include <sys/types.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include <gtest/gtest_prod.h> // for FRIEND_TEST | 11 #include <gtest/gtest_prod.h> // for FRIEND_TEST |
12 | 12 |
13 class MetricsLibraryInterface { | 13 class MetricsLibraryInterface { |
14 public: | 14 public: |
15 virtual void Init() = 0; | 15 virtual void Init() = 0; |
16 virtual bool SendToUMA(const std::string& name, int sample, | 16 virtual bool SendToUMA(const std::string& name, int sample, |
17 int min, int max, int nbuckets) = 0; | 17 int min, int max, int nbuckets) = 0; |
18 virtual bool SendEnumToUMA(const std::string& name, int sample, int max) = 0; | 18 virtual bool SendEnumToUMA(const std::string& name, int sample, int max) = 0; |
| 19 virtual bool SendUserActionToUMA(const std::string& action) = 0; |
19 virtual ~MetricsLibraryInterface() {} | 20 virtual ~MetricsLibraryInterface() {} |
20 }; | 21 }; |
21 | 22 |
22 // Library used to send metrics to both Autotest and Chrome/UMA. | 23 // Library used to send metrics to both Autotest and Chrome/UMA. |
23 class MetricsLibrary : public MetricsLibraryInterface { | 24 class MetricsLibrary : public MetricsLibraryInterface { |
24 public: | 25 public: |
25 MetricsLibrary(); | 26 MetricsLibrary(); |
26 | 27 |
27 // Initializes the library. | 28 // Initializes the library. |
28 void Init(); | 29 void Init(); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 static time_t cached_enabled_time_; | 119 static time_t cached_enabled_time_; |
119 | 120 |
120 // Cached state of whether or not metrics were enabled. | 121 // Cached state of whether or not metrics were enabled. |
121 static bool cached_enabled_; | 122 static bool cached_enabled_; |
122 | 123 |
123 const char* uma_events_file_; | 124 const char* uma_events_file_; |
124 const char* consent_file_; | 125 const char* consent_file_; |
125 }; | 126 }; |
126 | 127 |
127 #endif // METRICS_LIBRARY_H_ | 128 #endif // METRICS_LIBRARY_H_ |
OLD | NEW |