unsent_log_store_metrics_impl.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2016 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_METRICS_UNSENT_LOG_STORE_METRICS_IMPL_H_
  5. #define COMPONENTS_METRICS_UNSENT_LOG_STORE_METRICS_IMPL_H_
  6. #include "components/metrics/unsent_log_store_metrics.h"
  7. namespace metrics {
  8. // Implementation for recording metrics from UnsentLogStore.
  9. class UnsentLogStoreMetricsImpl : public UnsentLogStoreMetrics {
  10. public:
  11. // TODO(crbug/1265440): Refactor to use MetricsLogStore::StorageLimits.
  12. UnsentLogStoreMetricsImpl() = default;
  13. UnsentLogStoreMetricsImpl(const UnsentLogStoreMetricsImpl&) = delete;
  14. UnsentLogStoreMetricsImpl& operator=(const UnsentLogStoreMetricsImpl&) =
  15. delete;
  16. ~UnsentLogStoreMetricsImpl() override = default;
  17. // UnsentLogStoreMetrics:
  18. void RecordCompressionRatio(
  19. size_t compressed_size, size_t original_size) override;
  20. void RecordDroppedLogSize(size_t size) override;
  21. void RecordDroppedLogsNum(int dropped_logs_num) override;
  22. void RecordLastUnsentLogMetadataMetrics(int unsent_samples_count,
  23. int sent_samples_count,
  24. int persisted_size_in_kb) override;
  25. };
  26. } // namespace metrics
  27. #endif // COMPONENTS_METRICS_UNSENT_LOG_STORE_METRICS_IMPL_H_