blob: 7770619c73e8bcc7354a10c39a6f97a2d2ca626c [file] [log] [blame]
Tianjie Xu1b661142017-09-28 14:03:42 -07001//
2// Copyright (C) 2017 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17#ifndef UPDATE_ENGINE_METRICS_REPORTER_ANDROID_H_
18#define UPDATE_ENGINE_METRICS_REPORTER_ANDROID_H_
19
Marton Hunyadya0302682018-05-16 18:52:13 +020020#include <string>
21
Tianjie Xu1b661142017-09-28 14:03:42 -070022#include "update_engine/common/error_code.h"
23#include "update_engine/metrics_constants.h"
24#include "update_engine/metrics_reporter_interface.h"
25
26namespace chromeos_update_engine {
27
28class MetricsReporterAndroid : public MetricsReporterInterface {
29 public:
30 MetricsReporterAndroid() = default;
31
32 ~MetricsReporterAndroid() override = default;
33
Tianjie Xu1b661142017-09-28 14:03:42 -070034 void ReportRollbackMetrics(metrics::RollbackResult result) override {}
35
Marton Hunyadya0302682018-05-16 18:52:13 +020036 void ReportEnterpriseRollbackMetrics(
37 bool success, const std::string& rollback_version) override {}
38
Tianjie Xu1b661142017-09-28 14:03:42 -070039 void ReportDailyMetrics(base::TimeDelta os_age) override {}
40
41 void ReportUpdateCheckMetrics(
42 SystemState* system_state,
43 metrics::CheckResult result,
44 metrics::CheckReaction reaction,
45 metrics::DownloadErrorCode download_error_code) override {}
46
Tianjie Xu1f93d092017-10-09 12:13:29 -070047 void ReportUpdateAttemptMetrics(SystemState* system_state,
48 int attempt_number,
49 PayloadType payload_type,
50 base::TimeDelta duration,
51 base::TimeDelta duration_uptime,
52 int64_t payload_size,
53 metrics::AttemptResult attempt_result,
54 ErrorCode internal_error_code) override;
55
56 void ReportUpdateAttemptDownloadMetrics(
Tianjie Xu1b661142017-09-28 14:03:42 -070057 int64_t payload_bytes_downloaded,
58 int64_t payload_download_speed_bps,
59 DownloadSource download_source,
Tianjie Xu1b661142017-09-28 14:03:42 -070060 metrics::DownloadErrorCode payload_download_error_code,
Tianjie Xu82d99102017-11-02 22:26:19 -070061 metrics::ConnectionType connection_type) override;
Tianjie Xu1b661142017-09-28 14:03:42 -070062
Tianjie Xu52c678c2017-10-18 15:52:27 -070063 void ReportAbnormallyTerminatedUpdateAttemptMetrics() override;
Tianjie Xu1b661142017-09-28 14:03:42 -070064
65 void ReportSuccessfulUpdateMetrics(
66 int attempt_count,
67 int updates_abandoned_count,
68 PayloadType payload_type,
69 int64_t payload_size,
70 int64_t num_bytes_downloaded[kNumDownloadSources],
71 int download_overhead_percentage,
72 base::TimeDelta total_duration,
Sen Jiang8712e962018-05-08 12:12:28 -070073 base::TimeDelta total_duration_uptime,
Tianjie Xu1b661142017-09-28 14:03:42 -070074 int reboot_count,
Tianjie Xu52c678c2017-10-18 15:52:27 -070075 int url_switch_count) override;
Tianjie Xu1b661142017-09-28 14:03:42 -070076
77 void ReportCertificateCheckMetrics(ServerToCheck server_to_check,
78 CertificateCheckResult result) override {}
79
80 void ReportFailedUpdateCount(int target_attempt) override {}
81
82 void ReportTimeToReboot(int time_to_reboot_minutes) override {}
83
84 void ReportInstallDateProvisioningSource(int source, int max) override {}
85
Amin Hassani80f4d4c2018-05-16 13:34:00 -070086 void ReportInternalErrorCode(ErrorCode error_code) override {}
87
Marton Hunyadyffbfdfb2018-05-30 13:03:29 +020088 void ReportKeyVersionMetrics(int kernel_min_version,
89 int kernel_max_rollforward_version,
90 bool kernel_max_rollforward_success) override {}
91
May Lippert60aa3ca2018-08-15 16:55:29 -070092 void ReportEnterpriseUpdateSeenToDownloadDays(
93 bool has_time_restriction_policy, int time_to_update_days) override {}
94
Tianjie Xu1b661142017-09-28 14:03:42 -070095 private:
96 DISALLOW_COPY_AND_ASSIGN(MetricsReporterAndroid);
97};
98
99} // namespace chromeos_update_engine
100
101#endif // UPDATE_ENGINE_METRICS_REPORTER_ANDROID_H_