1 // Copyright 2022 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_METRICS_FEATURES_H_ 6 #define COMPONENTS_METRICS_METRICS_FEATURES_H_ 7 8 #include "base/feature_list.h" 9 #include "base/metrics/field_trial_params.h" 10 11 namespace metrics::features { 12 13 // Determines at what point the metrics service is allowed to close a log when 14 // Chrome is closed (and backgrounded/foregrounded for mobile platforms). When 15 // this feature is disabled, the metrics service can only close a log if it has 16 // already started sending logs. When this feature is enabled, the metrics 17 // service can close a log starting from when the first log is opened. 18 BASE_DECLARE_FEATURE(kMetricsServiceAllowEarlyLogClose); 19 20 // This can be used to disable structured metrics as a whole. 21 BASE_DECLARE_FEATURE(kStructuredMetrics); 22 23 // Determines whether to schedule a flush of persistent histogram memory 24 // immediately after writing a system profile to it. 25 BASE_DECLARE_FEATURE(kFlushPersistentSystemProfileOnWrite); 26 27 // Determines whether to perform histogram delta snapshots in a background 28 // thread (in contrast to snapshotting unlogged samples in the background, then 29 // marking them as logged on the main thread). 30 BASE_DECLARE_FEATURE(kMetricsServiceDeltaSnapshotInBg); 31 32 // Determines whether to always flush Local State immediately after an UMA/UKM 33 // log upload. If this is disabled, Local State is only immediately flushed 34 // after an upload if this is a mobile platform and the browser is in the 35 // background. 36 BASE_DECLARE_FEATURE(kReportingServiceAlwaysFlush); 37 38 // Controls trimming for metrics logs. This feature allows tuning of the log 39 // trimming behaviour via serverside parameters. Do not remove. See 40 // components/metrics/metrics_service_client.cc and 41 // components/metrics/unsent_log_store.cc. 42 BASE_DECLARE_FEATURE(kMetricsLogTrimming); 43 44 } // namespace metrics::features 45 46 #endif // COMPONENTS_METRICS_METRICS_FEATURES_H_ 47