• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2021 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 #include "components/metrics/structured/structured_metrics_features.h"
6 
7 #include "base/metrics/field_trial_params.h"
8 
9 namespace metrics::structured {
10 
11 BASE_FEATURE(kStructuredMetrics,
12              "EnableStructuredMetrics",
13              base::FEATURE_ENABLED_BY_DEFAULT);
14 
15 BASE_FEATURE(kEventSequenceLogging,
16              "EnableEventSequenceLogging",
17              base::FEATURE_DISABLED_BY_DEFAULT);
18 
19 // TODO(b/181724341): Remove this experimental once the feature is rolled out.
20 BASE_FEATURE(kBluetoothSessionizedMetrics,
21              "BluetoothSessionizedMetrics",
22              base::FEATURE_ENABLED_BY_DEFAULT);
23 
24 BASE_FEATURE(kFastPairMetrics,
25              "FastPairMetrics",
26              base::FEATURE_ENABLED_BY_DEFAULT);
27 
28 constexpr base::FeatureParam<int> kLimitFilesPerScanParam{&kStructuredMetrics,
29                                                           "file_limit", 50};
30 constexpr base::FeatureParam<int> kFileSizeByteLimitParam{
31     &kStructuredMetrics, "file_byte_limit", 50000};
32 
33 constexpr base::FeatureParam<std::string> kDisallowedProjectsParam{
34     &kStructuredMetrics, "disabled_projects", ""};
35 
IsIndependentMetricsUploadEnabled()36 bool IsIndependentMetricsUploadEnabled() {
37   return base::GetFieldTrialParamByFeatureAsBool(
38       kStructuredMetrics, "enable_independent_metrics_upload", true);
39 }
40 
GetFileLimitPerScan()41 int GetFileLimitPerScan() {
42   return kLimitFilesPerScanParam.Get();
43 }
44 
GetFileSizeByteLimit()45 int GetFileSizeByteLimit() {
46   return kFileSizeByteLimitParam.Get();
47 }
48 
GetDisabledProjects()49 std::string GetDisabledProjects() {
50   return kDisallowedProjectsParam.Get();
51 }
52 
53 }  // namespace metrics::structured
54