OLD | NEW |
| (Empty) |
1 // Copyright 2008-2010 Google Inc. | |
2 // | |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | |
4 // you may not use this file except in compliance with the License. | |
5 // You may obtain a copy of the License at | |
6 // | |
7 // http://www.apache.org/licenses/LICENSE-2.0 | |
8 // | |
9 // Unless required by applicable law or agreed to in writing, software | |
10 // distributed under the License is distributed on an "AS IS" BASIS, | |
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 // See the License for the specific language governing permissions and | |
13 // limitations under the License. | |
14 // ======================================================================== | |
15 | |
16 // Constants for the statsreport library. | |
17 | |
18 #ifndef OMAHA_COMMON_STATS_UPLOADER_H__ | |
19 #define OMAHA_COMMON_STATS_UPLOADER_H__ | |
20 | |
21 #include <windows.h> | |
22 #include <tchar.h> | |
23 | |
24 namespace omaha { | |
25 | |
26 // The product name is chosen so that the stats are persisted under | |
27 // the Google Update registry key for the machine or user, respectively. | |
28 const TCHAR* const kMetricsProductName = _T("Update"); | |
29 | |
30 const TCHAR* const kMetricsServerParamSourceId = _T("sourceid"); | |
31 const TCHAR* const kMetricsServerParamVersion = _T("v"); | |
32 const TCHAR* const kMetricsServerParamIsMachine = _T("ismachine"); | |
33 const TCHAR* const kMetricsServerTestSource = _T("testsource"); | |
34 const TCHAR* const kMetricsServerUserId = _T("ui"); | |
35 | |
36 // Metrics are uploaded every 25 hours. | |
37 const int kMetricsUploadIntervalSec = 25 * 60 * 60; | |
38 | |
39 // Deletes existing metrics and initializes 'LastTransmission' to current time. | |
40 HRESULT ResetMetrics(bool is_machine); | |
41 | |
42 // Aggregates metrics by saving them in registry. | |
43 HRESULT AggregateMetrics(bool is_machine); | |
44 | |
45 // Aggregates and reports the metrics if needed, as defined by the metrics | |
46 // upload interval. The interval is ignored when 'force_report' is true. | |
47 HRESULT AggregateAndReportMetrics(bool is_machine, bool force_report); | |
48 | |
49 } // namespace omaha | |
50 | |
51 #endif // OMAHA_COMMON_STATS_UPLOADER_H__ | |
52 | |
OLD | NEW |