xref: /aosp_15_r20/external/cronet/components/metrics/metrics_switches.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2014 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_SWITCHES_H_
6 #define COMPONENTS_METRICS_METRICS_SWITCHES_H_
7 
8 namespace base {
9 class CommandLine;
10 }
11 
12 namespace metrics {
13 namespace switches {
14 
15 // Alphabetical list of switches specific to the metrics component. Document
16 // each in the .cc file.
17 
18 extern const char kExportUmaLogsToFile[];
19 extern const char kForceEnableMetricsReporting[];
20 extern const char kMetricsRecordingOnly[];
21 extern const char kMetricsUploadIntervalSec[];
22 extern const char kResetVariationState[];
23 extern const char kUkmServerUrl[];
24 extern const char kUmaServerUrl[];
25 extern const char kUmaInsecureServerUrl[];
26 
27 }  // namespace switches
28 
29 // Returns true if `kMetricsRecordingOnly` is on the command line for the
30 // current process.
31 bool IsMetricsRecordingOnlyEnabled();
32 
33 // Returns true if `kForceEnableMetricsReporting` is on the command line for the
34 // current process.
35 bool IsMetricsReportingForceEnabled();
36 
37 // Returns true if `kForceMsbbSettingOnForUkm` is on the command line for the
38 // current process.
39 bool IsMsbbSettingForcedOnForUkm();
40 
41 // Adds `kMetricsRecordingOnly` to `command_line` if not already present.
42 void EnableMetricsRecordingOnlyForTesting(base::CommandLine* command_line);
43 
44 // Adds `kForceEnableMetricsReporting` to the command line for the current
45 // process if not already present.
46 void ForceEnableMetricsReportingForTesting();
47 
48 }  // namespace metrics
49 
50 #endif  // COMPONENTS_METRICS_METRICS_SWITCHES_H_
51