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_ANDROID_H_ 18 #define UPDATE_ENGINE_METRICS_REPORTER_ANDROID_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 24 namespace chromeos_update_engine { 25 26 class MetricsReporterAndroid : public MetricsReporterInterface { 27 public: 28 MetricsReporterAndroid() = default; 29 30 ~MetricsReporterAndroid() override = default; 31 Initialize()32 void Initialize() override {} 33 ReportRollbackMetrics(metrics::RollbackResult result)34 void ReportRollbackMetrics(metrics::RollbackResult result) override {} 35 ReportDailyMetrics(base::TimeDelta os_age)36 void ReportDailyMetrics(base::TimeDelta os_age) override {} 37 ReportUpdateCheckMetrics(SystemState * system_state,metrics::CheckResult result,metrics::CheckReaction reaction,metrics::DownloadErrorCode download_error_code)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, 70 int reboot_count, 71 int url_switch_count) override; 72 ReportCertificateCheckMetrics(ServerToCheck server_to_check,CertificateCheckResult result)73 void ReportCertificateCheckMetrics(ServerToCheck server_to_check, 74 CertificateCheckResult result) override {} 75 ReportFailedUpdateCount(int target_attempt)76 void ReportFailedUpdateCount(int target_attempt) override {} 77 ReportTimeToReboot(int time_to_reboot_minutes)78 void ReportTimeToReboot(int time_to_reboot_minutes) override {} 79 ReportInstallDateProvisioningSource(int source,int max)80 void ReportInstallDateProvisioningSource(int source, int max) override {} 81 82 private: 83 DISALLOW_COPY_AND_ASSIGN(MetricsReporterAndroid); 84 }; 85 86 } // namespace chromeos_update_engine 87 88 #endif // UPDATE_ENGINE_METRICS_REPORTER_ANDROID_H_ 89