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 BASE_CPU_REDUCTION_EXPERIMENT_H_ 6 #define BASE_CPU_REDUCTION_EXPERIMENT_H_ 7 8 #include "base/base_export.h" 9 10 namespace base { 11 12 // Returns whether the cpu cycle reduction experiment is running. 13 // The goal of this experiment is to better understand the relationship between 14 // total CPU cycles used across the fleet and top-line chrome metrics. 15 BASE_EXPORT bool IsRunningCpuReductionExperiment(); 16 17 // Must be called after FeatureList initialization and while chrome is still 18 // single-threaded. 19 BASE_EXPORT void InitializeCpuReductionExperiment(); 20 21 // Returns true if the next sample should be recorded to an histogram 22 // sub-sampled under the CPU reduction experiment. Returns true randomly for 23 // ~1/1000 calls when the experiment is enabled, or always returns true when the 24 // experiment is disabled. 25 BASE_EXPORT bool ShouldLogHistogramForCpuReductionExperiment(); 26 27 } // namespace base 28 29 #endif // BASE_CPU_REDUCTION_EXPERIMENT_H_ 30