Debian Codegraph @

src/core/lib/experiments/config.h

raw
1 // Copyright 2022 gRPC authors.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 #ifndef GRPC_CORE_LIB_EXPERIMENTS_CONFIG_H
16 #define GRPC_CORE_LIB_EXPERIMENTS_CONFIG_H
17
18 #include <grpc/support/port_platform.h>
19
20 #include <stddef.h>
21
22 #include "absl/strings/string_view.h"
23
24 namespace grpc_core {
25
26 // Return true if experiment \a experiment_id is enabled.
27 // Experiments are numbered by their order in the g_experiment_metadata array
28 // declared in experiments.h.
29 bool IsExperimentEnabled(size_t experiment_id);
30
31 // Print out a list of all experiments that are built into this binary.
32 void PrintExperimentsList();
33
34 // Force an experiment to be on or off.
35 // Must be called before experiments are configured (the first
36 // IsExperimentEnabled call).
37 // If the experiment does not exist, emits a warning but continues execution.
38 // If this is called twice for the same experiment, both calls must agree.
39 void ForceEnableExperiment(absl::string_view experiment_name, bool enable);
40
41 } // namespace grpc_core
42
43 #endif // GRPC_CORE_LIB_EXPERIMENTS_CONFIG_H