blob: 6ffd05cd4c5d1c050fc0d059cc3ad9c66d7982dd [file] [log] [blame]
Tianjie Xud4c5deb2017-10-24 11:17:03 -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_STUB_H_
18#define UPDATE_ENGINE_METRICS_REPORTER_STUB_H_
19
20#include "update_engine/common/error_code.h"
21#include "update_engine/metrics_constants.h"
22#include "update_engine/metrics_reporter_interface.h"
23
24namespace chromeos_update_engine {
25
26class MetricsReporterStub : public MetricsReporterInterface {
27 public:
28 MetricsReporterStub() = default;
29
30 ~MetricsReporterStub() override = default;
31
32 void Initialize() override {}
33
34 void ReportRollbackMetrics(metrics::RollbackResult result) override {}
35
36 void ReportDailyMetrics(base::TimeDelta os_age) override {}
37
38 void ReportUpdateCheckMetrics(
39 SystemState* system_state,
40 metrics::CheckResult result,
41 metrics::CheckReaction reaction,
42 metrics::DownloadErrorCode download_error_code) override {}
43
44 void ReportUpdateAttemptMetrics(SystemState* system_state,
45 int attempt_number,
46 PayloadType payload_type,
47 base::TimeDelta duration,
48 base::TimeDelta duration_uptime,
49 int64_t payload_size,
50 metrics::AttemptResult attempt_result,
51 ErrorCode internal_error_code) override {}
52
53 void ReportUpdateAttemptDownloadMetrics(
54 int64_t payload_bytes_downloaded,
55 int64_t payload_download_speed_bps,
56 DownloadSource download_source,
57 metrics::DownloadErrorCode payload_download_error_code,
58 metrics::ConnectionType connection_type) override {}
59
60 void ReportAbnormallyTerminatedUpdateAttemptMetrics() override {}
61
62 void ReportSuccessfulUpdateMetrics(
63 int attempt_count,
64 int updates_abandoned_count,
65 PayloadType payload_type,
66 int64_t payload_size,
67 int64_t num_bytes_downloaded[kNumDownloadSources],
68 int download_overhead_percentage,
69 base::TimeDelta total_duration,
Sen Jiang8712e962018-05-08 12:12:28 -070070 base::TimeDelta total_duration_uptime,
Tianjie Xud4c5deb2017-10-24 11:17:03 -070071 int reboot_count,
72 int url_switch_count) override {}
73
74 void ReportCertificateCheckMetrics(ServerToCheck server_to_check,
75 CertificateCheckResult result) override {}
76
77 void ReportFailedUpdateCount(int target_attempt) override {}
78
79 void ReportTimeToReboot(int time_to_reboot_minutes) override {}
80
81 void ReportInstallDateProvisioningSource(int source, int max) override {}
82
83 private:
84 DISALLOW_COPY_AND_ASSIGN(MetricsReporterStub);
85};
86
87} // namespace chromeos_update_engine
88
89#endif // UPDATE_ENGINE_METRICS_REPORTER_STUB_H_