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