Josh Hilke | be691d75 | 2023-01-09 18:50:57 | [diff] [blame] | 1 | // Copyright 2023 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_REPORTING_METRICS_MANUAL_COLLECTOR_H_ |
| 6 | #define COMPONENTS_REPORTING_METRICS_MANUAL_COLLECTOR_H_ |
| 7 | |
| 8 | #include <memory> |
| 9 | #include <string> |
| 10 | |
| 11 | #include "components/reporting/metrics/collector_base.h" |
| 12 | #include "components/reporting/proto/synced/metric_data.pb.h" |
| 13 | |
| 14 | namespace reporting { |
| 15 | |
| 16 | class MetricReportQueue; |
| 17 | class MetricReportingController; |
| 18 | class ReportingSettings; |
Vignesh Shenvi | 51b90be | 2023-12-01 01:15:52 | [diff] [blame^] | 19 | |
Josh Hilke | be691d75 | 2023-01-09 18:50:57 | [diff] [blame] | 20 | // Class to collect and report metric data when manually triggered. Does not |
| 21 | // automatically collect data. Necessary reporting settings must be set or |
| 22 | // `setting_enabled_default_value` must be set to True in order to trigger |
| 23 | // collection. |
| 24 | class ManualCollector : public CollectorBase { |
| 25 | public: |
Vignesh Shenvi | 51b90be | 2023-12-01 01:15:52 | [diff] [blame^] | 26 | // Metrics name for reporting missing metric data to UMA. |
| 27 | static constexpr char kNoMetricDataMetricsName[] = |
| 28 | "Browser.ERP.MetricsReporting.ManualCollectorNoMetricData"; |
| 29 | |
Josh Hilke | be691d75 | 2023-01-09 18:50:57 | [diff] [blame] | 30 | ManualCollector(Sampler* sampler, |
| 31 | MetricReportQueue* metric_report_queue, |
| 32 | ReportingSettings* reporting_settings, |
| 33 | const std::string& setting_path, |
| 34 | bool setting_enabled_default_value); |
| 35 | |
|
|