| Tianjie Xu | d4c5deb | 2017-10-24 11:17:03 -0700 | [diff] [blame] | 1 | // | 
|  | 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 |  | 
| Marton Hunyady | a030268 | 2018-05-16 18:52:13 +0200 | [diff] [blame] | 20 | #include <string> | 
|  | 21 |  | 
| Tianjie Xu | d4c5deb | 2017-10-24 11:17:03 -0700 | [diff] [blame] | 22 | #include "update_engine/common/error_code.h" | 
|  | 23 | #include "update_engine/metrics_constants.h" | 
|  | 24 | #include "update_engine/metrics_reporter_interface.h" | 
|  | 25 |  | 
|  | 26 | namespace chromeos_update_engine { | 
|  | 27 |  | 
|  | 28 | class MetricsReporterStub : public MetricsReporterInterface { | 
|  | 29 | public: | 
|  | 30 | MetricsReporterStub() = default; | 
|  | 31 |  | 
|  | 32 | ~MetricsReporterStub() override = default; | 
|  | 33 |  | 
|  | 34 | void Initialize() override {} | 
|  | 35 |  | 
|  | 36 | void ReportRollbackMetrics(metrics::RollbackResult result) override {} | 
|  | 37 |  | 
| Marton Hunyady | a030268 | 2018-05-16 18:52:13 +0200 | [diff] [blame] | 38 | void ReportEnterpriseRollbackMetrics( | 
|  | 39 | bool success, const std::string& rollback_version) override {} | 
|  | 40 |  | 
| Tianjie Xu | d4c5deb | 2017-10-24 11:17:03 -0700 | [diff] [blame] | 41 | void ReportDailyMetrics(base::TimeDelta os_age) override {} | 
|  | 42 |  | 
|  | 43 | void ReportUpdateCheckMetrics( | 
|  | 44 | SystemState* system_state, | 
|  | 45 | metrics::CheckResult result, | 
|  | 46 | metrics::CheckReaction reaction, | 
|  | 47 | metrics::DownloadErrorCode download_error_code) override {} | 
|  | 48 |  | 
|  | 49 | void ReportUpdateAttemptMetrics(SystemState* system_state, | 
|  | 50 | int attempt_number, | 
|  | 51 | PayloadType payload_type, | 
|  | 52 | base::TimeDelta duration, | 
|  | 53 | base::TimeDelta duration_uptime, | 
|  | 54 | int64_t payload_size, | 
|  | 55 | metrics::AttemptResult attempt_result, | 
|  | 56 | ErrorCode internal_error_code) override {} | 
|  | 57 |  | 
|  | 58 | void ReportUpdateAttemptDownloadMetrics( | 
|  | 59 | int64_t payload_bytes_downloaded, | 
|  | 60 | int64_t payload_download_speed_bps, | 
|  | 61 | DownloadSource download_source, | 
|  | 62 | metrics::DownloadErrorCode payload_download_error_code, | 
|  | 63 | metrics::ConnectionType connection_type) override {} | 
|  | 64 |  | 
|  | 65 | void ReportAbnormallyTerminatedUpdateAttemptMetrics() override {} | 
|  | 66 |  | 
|  | 67 | void ReportSuccessfulUpdateMetrics( | 
|  | 68 | int attempt_count, | 
|  | 69 | int updates_abandoned_count, | 
|  | 70 | PayloadType payload_type, | 
|  | 71 | int64_t payload_size, | 
|  | 72 | int64_t num_bytes_downloaded[kNumDownloadSources], | 
|  | 73 | int download_overhead_percentage, | 
|  | 74 | base::TimeDelta total_duration, | 
| Sen Jiang | 8712e96 | 2018-05-08 12:12:28 -0700 | [diff] [blame] | 75 | base::TimeDelta total_duration_uptime, | 
| Tianjie Xu | d4c5deb | 2017-10-24 11:17:03 -0700 | [diff] [blame] | 76 | int reboot_count, | 
|  | 77 | int url_switch_count) override {} | 
|  | 78 |  | 
|  | 79 | void ReportCertificateCheckMetrics(ServerToCheck server_to_check, | 
|  | 80 | CertificateCheckResult result) override {} | 
|  | 81 |  | 
|  | 82 | void ReportFailedUpdateCount(int target_attempt) override {} | 
|  | 83 |  | 
|  | 84 | void ReportTimeToReboot(int time_to_reboot_minutes) override {} | 
|  | 85 |  | 
|  | 86 | void ReportInstallDateProvisioningSource(int source, int max) override {} | 
|  | 87 |  | 
| Sen Jiang | 456853f | 2018-08-13 15:41:43 -0700 | [diff] [blame] | 88 | void ReportInternalErrorCode(ErrorCode error_code) override {} | 
|  | 89 |  | 
| Marton Hunyady | ffbfdfb | 2018-05-30 13:03:29 +0200 | [diff] [blame] | 90 | void ReportKeyVersionMetrics(int kernel_min_version, | 
|  | 91 | int kernel_max_rollforward_version, | 
|  | 92 | bool kernel_max_rollforward_success) override {} | 
|  | 93 |  | 
| Tianjie Xu | d4c5deb | 2017-10-24 11:17:03 -0700 | [diff] [blame] | 94 | private: | 
|  | 95 | DISALLOW_COPY_AND_ASSIGN(MetricsReporterStub); | 
|  | 96 | }; | 
|  | 97 |  | 
|  | 98 | }  // namespace chromeos_update_engine | 
|  | 99 |  | 
|  | 100 | #endif  // UPDATE_ENGINE_METRICS_REPORTER_STUB_H_ |