1 // Copyright 2023 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 // Auto generated by tools/codegen/core/gen_experiments.py
16 //
17 // This file contains the autogenerated parts of the experiments API.
18 //
19 // It generates two symbols for each experiment.
20 //
21 // For the experiment named new_car_project, it generates:
22 //
23 // - a function IsNewCarProjectEnabled() that returns true if the experiment
24 //   should be enabled at runtime.
25 //
26 // - a macro GRPC_EXPERIMENT_IS_INCLUDED_NEW_CAR_PROJECT that is defined if the
27 //   experiment *could* be enabled at runtime.
28 //
29 // The function is used to determine whether to run the experiment or
30 // non-experiment code path.
31 //
32 // If the experiment brings significant bloat, the macro can be used to avoid
33 // including the experiment code path in the binary for binaries that are size
34 // sensitive.
35 //
36 // By default that includes our iOS and Android builds.
37 //
38 // Finally, a small array is included that contains the metadata for each
39 // experiment.
40 //
41 // A macro, GRPC_EXPERIMENTS_ARE_FINAL, controls whether we fix experiment
42 // configuration at build time (if it's defined) or allow it to be tuned at
43 // runtime (if it's disabled).
44 //
45 // If you are using the Bazel build system, that macro can be configured with
46 // --define=grpc_experiments_are_final=true
47 
48 #ifndef GRPC_SRC_CORE_LIB_EXPERIMENTS_EXPERIMENTS_H
49 #define GRPC_SRC_CORE_LIB_EXPERIMENTS_EXPERIMENTS_H
50 
51 #include <grpc/support/port_platform.h>
52 
53 #include <stddef.h>
54 
55 #include "src/core/lib/experiments/config.h"
56 
57 namespace grpc_core {
58 
59 #ifdef GRPC_EXPERIMENTS_ARE_FINAL
IsTcpFrameSizeTuningEnabled()60 inline bool IsTcpFrameSizeTuningEnabled() { return false; }
IsTcpRcvLowatEnabled()61 inline bool IsTcpRcvLowatEnabled() { return false; }
IsPeerStateBasedFramingEnabled()62 inline bool IsPeerStateBasedFramingEnabled() { return false; }
IsMemoryPressureControllerEnabled()63 inline bool IsMemoryPressureControllerEnabled() { return false; }
IsUnconstrainedMaxQuotaBufferSizeEnabled()64 inline bool IsUnconstrainedMaxQuotaBufferSizeEnabled() { return false; }
IsEventEngineClientEnabled()65 inline bool IsEventEngineClientEnabled() { return false; }
66 #define GRPC_EXPERIMENT_IS_INCLUDED_MONITORING_EXPERIMENT
IsMonitoringExperimentEnabled()67 inline bool IsMonitoringExperimentEnabled() { return true; }
IsPromiseBasedClientCallEnabled()68 inline bool IsPromiseBasedClientCallEnabled() { return false; }
IsFreeLargeAllocatorEnabled()69 inline bool IsFreeLargeAllocatorEnabled() { return false; }
IsPromiseBasedServerCallEnabled()70 inline bool IsPromiseBasedServerCallEnabled() { return false; }
IsTransportSuppliesClientLatencyEnabled()71 inline bool IsTransportSuppliesClientLatencyEnabled() { return false; }
IsEventEngineListenerEnabled()72 inline bool IsEventEngineListenerEnabled() { return false; }
IsScheduleCancellationOverWriteEnabled()73 inline bool IsScheduleCancellationOverWriteEnabled() { return false; }
IsTraceRecordCallopsEnabled()74 inline bool IsTraceRecordCallopsEnabled() { return false; }
IsEventEngineDnsEnabled()75 inline bool IsEventEngineDnsEnabled() { return false; }
IsWorkStealingEnabled()76 inline bool IsWorkStealingEnabled() { return false; }
IsClientPrivacyEnabled()77 inline bool IsClientPrivacyEnabled() { return false; }
IsCanaryClientPrivacyEnabled()78 inline bool IsCanaryClientPrivacyEnabled() { return false; }
IsServerPrivacyEnabled()79 inline bool IsServerPrivacyEnabled() { return false; }
80 #else
81 #define GRPC_EXPERIMENT_IS_INCLUDED_TCP_FRAME_SIZE_TUNING
82 inline bool IsTcpFrameSizeTuningEnabled() { return IsExperimentEnabled(0); }
83 #define GRPC_EXPERIMENT_IS_INCLUDED_TCP_RCV_LOWAT
84 inline bool IsTcpRcvLowatEnabled() { return IsExperimentEnabled(1); }
85 #define GRPC_EXPERIMENT_IS_INCLUDED_PEER_STATE_BASED_FRAMING
86 inline bool IsPeerStateBasedFramingEnabled() { return IsExperimentEnabled(2); }
87 #define GRPC_EXPERIMENT_IS_INCLUDED_MEMORY_PRESSURE_CONTROLLER
88 inline bool IsMemoryPressureControllerEnabled() {
89   return IsExperimentEnabled(3);
90 }
91 #define GRPC_EXPERIMENT_IS_INCLUDED_UNCONSTRAINED_MAX_QUOTA_BUFFER_SIZE
92 inline bool IsUnconstrainedMaxQuotaBufferSizeEnabled() {
93   return IsExperimentEnabled(4);
94 }
95 #define GRPC_EXPERIMENT_IS_INCLUDED_EVENT_ENGINE_CLIENT
96 inline bool IsEventEngineClientEnabled() { return IsExperimentEnabled(5); }
97 #define GRPC_EXPERIMENT_IS_INCLUDED_MONITORING_EXPERIMENT
98 inline bool IsMonitoringExperimentEnabled() { return IsExperimentEnabled(6); }
99 #define GRPC_EXPERIMENT_IS_INCLUDED_PROMISE_BASED_CLIENT_CALL
100 inline bool IsPromiseBasedClientCallEnabled() { return IsExperimentEnabled(7); }
101 #define GRPC_EXPERIMENT_IS_INCLUDED_FREE_LARGE_ALLOCATOR
102 inline bool IsFreeLargeAllocatorEnabled() { return IsExperimentEnabled(8); }
103 #define GRPC_EXPERIMENT_IS_INCLUDED_PROMISE_BASED_SERVER_CALL
104 inline bool IsPromiseBasedServerCallEnabled() { return IsExperimentEnabled(9); }
105 #define GRPC_EXPERIMENT_IS_INCLUDED_TRANSPORT_SUPPLIES_CLIENT_LATENCY
106 inline bool IsTransportSuppliesClientLatencyEnabled() {
107   return IsExperimentEnabled(10);
108 }
109 #define GRPC_EXPERIMENT_IS_INCLUDED_EVENT_ENGINE_LISTENER
110 inline bool IsEventEngineListenerEnabled() { return IsExperimentEnabled(11); }
111 #define GRPC_EXPERIMENT_IS_INCLUDED_SCHEDULE_CANCELLATION_OVER_WRITE
112 inline bool IsScheduleCancellationOverWriteEnabled() {
113   return IsExperimentEnabled(12);
114 }
115 #define GRPC_EXPERIMENT_IS_INCLUDED_TRACE_RECORD_CALLOPS
116 inline bool IsTraceRecordCallopsEnabled() { return IsExperimentEnabled(13); }
117 #define GRPC_EXPERIMENT_IS_INCLUDED_EVENT_ENGINE_DNS
118 inline bool IsEventEngineDnsEnabled() { return IsExperimentEnabled(14); }
119 #define GRPC_EXPERIMENT_IS_INCLUDED_WORK_STEALING
120 inline bool IsWorkStealingEnabled() { return IsExperimentEnabled(15); }
121 #define GRPC_EXPERIMENT_IS_INCLUDED_CLIENT_PRIVACY
122 inline bool IsClientPrivacyEnabled() { return IsExperimentEnabled(16); }
123 #define GRPC_EXPERIMENT_IS_INCLUDED_CANARY_CLIENT_PRIVACY
124 inline bool IsCanaryClientPrivacyEnabled() { return IsExperimentEnabled(17); }
125 #define GRPC_EXPERIMENT_IS_INCLUDED_SERVER_PRIVACY
126 inline bool IsServerPrivacyEnabled() { return IsExperimentEnabled(18); }
127 
128 constexpr const size_t kNumExperiments = 19;
129 extern const ExperimentMetadata g_experiment_metadata[kNumExperiments];
130 
131 #endif
132 }  // namespace grpc_core
133 
134 #endif  // GRPC_SRC_CORE_LIB_EXPERIMENTS_EXPERIMENTS_H
135