xref: /aosp_15_r20/external/cronet/components/metrics/unsent_log_store_metrics_impl.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2016 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef COMPONENTS_METRICS_UNSENT_LOG_STORE_METRICS_IMPL_H_
6 #define COMPONENTS_METRICS_UNSENT_LOG_STORE_METRICS_IMPL_H_
7 
8 #include "components/metrics/unsent_log_store_metrics.h"
9 
10 namespace metrics {
11 
12 // Implementation for recording metrics from UnsentLogStore.
13 class UnsentLogStoreMetricsImpl : public UnsentLogStoreMetrics {
14  public:
15   UnsentLogStoreMetricsImpl() = default;
16 
17   UnsentLogStoreMetricsImpl(const UnsentLogStoreMetricsImpl&) = delete;
18   UnsentLogStoreMetricsImpl& operator=(const UnsentLogStoreMetricsImpl&) =
19       delete;
20 
21   ~UnsentLogStoreMetricsImpl() override = default;
22 
23   // UnsentLogStoreMetrics:
24   void RecordCompressionRatio(
25     size_t compressed_size, size_t original_size) override;
26   void RecordDroppedLogSize(size_t size) override;
27   void RecordDroppedLogsNum(int dropped_logs_num) override;
28   void RecordLastUnsentLogMetadataMetrics(int unsent_samples_count,
29                                           int sent_samples_count,
30                                           int persisted_size_in_kb) override;
31 };
32 
33 }  // namespace metrics
34 
35 #endif  // COMPONENTS_METRICS_UNSENT_LOG_STORE_METRICS_IMPL_H_
36