metrics_reporter_android.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. #ifndef UPDATE_ENGINE_METRICS_REPORTER_ANDROID_H_
  17. #define UPDATE_ENGINE_METRICS_REPORTER_ANDROID_H_
  18. #include <string>
  19. #include "update_engine/common/error_code.h"
  20. #include "update_engine/metrics_constants.h"
  21. #include "update_engine/metrics_reporter_interface.h"
  22. namespace chromeos_update_engine {
  23. class MetricsReporterAndroid : public MetricsReporterInterface {
  24. public:
  25. MetricsReporterAndroid() = default;
  26. ~MetricsReporterAndroid() override = default;
  27. void Initialize() override {}
  28. void ReportRollbackMetrics(metrics::RollbackResult result) override {}
  29. void ReportEnterpriseRollbackMetrics(
  30. bool success, const std::string& rollback_version) override {}
  31. void ReportDailyMetrics(base::TimeDelta os_age) override {}
  32. void ReportUpdateCheckMetrics(
  33. SystemState* system_state,
  34. metrics::CheckResult result,
  35. metrics::CheckReaction reaction,
  36. metrics::DownloadErrorCode download_error_code) override {}
  37. void ReportUpdateAttemptMetrics(SystemState* system_state,
  38. int attempt_number,
  39. PayloadType payload_type,
  40. base::TimeDelta duration,
  41. base::TimeDelta duration_uptime,
  42. int64_t payload_size,
  43. metrics::AttemptResult attempt_result,
  44. ErrorCode internal_error_code) override;
  45. void ReportUpdateAttemptDownloadMetrics(
  46. int64_t payload_bytes_downloaded,
  47. int64_t payload_download_speed_bps,
  48. DownloadSource download_source,
  49. metrics::DownloadErrorCode payload_download_error_code,
  50. metrics::ConnectionType connection_type) override;
  51. void ReportAbnormallyTerminatedUpdateAttemptMetrics() override;
  52. void ReportSuccessfulUpdateMetrics(
  53. int attempt_count,
  54. int updates_abandoned_count,
  55. PayloadType payload_type,
  56. int64_t payload_size,
  57. int64_t num_bytes_downloaded[kNumDownloadSources],
  58. int download_overhead_percentage,
  59. base::TimeDelta total_duration,
  60. base::TimeDelta total_duration_uptime,
  61. int reboot_count,
  62. int url_switch_count) override;
  63. void ReportCertificateCheckMetrics(ServerToCheck server_to_check,
  64. CertificateCheckResult result) override {}
  65. void ReportFailedUpdateCount(int target_attempt) override {}
  66. void ReportTimeToReboot(int time_to_reboot_minutes) override {}
  67. void ReportInstallDateProvisioningSource(int source, int max) override {}
  68. void ReportInternalErrorCode(ErrorCode error_code) override {}
  69. void ReportKeyVersionMetrics(int kernel_min_version,
  70. int kernel_max_rollforward_version,
  71. bool kernel_max_rollforward_success) override {}
  72. void ReportEnterpriseUpdateSeenToDownloadDays(
  73. bool has_time_restriction_policy, int time_to_update_days) override {}
  74. private:
  75. DISALLOW_COPY_AND_ASSIGN(MetricsReporterAndroid);
  76. };
  77. } // namespace chromeos_update_engine
  78. #endif // UPDATE_ENGINE_METRICS_REPORTER_ANDROID_H_