Go to the documentation of this file.
39 : max_milli_tokens_(max_milli_tokens),
40 milli_token_ratio_(milli_token_ratio) {
46 if (old_throttle_data !=
nullptr) {
47 double token_fraction =
51 initial_milli_tokens =
57 if (old_throttle_data !=
nullptr) {
60 reinterpret_cast<gpr_atm>(
this));
68 if (replacement !=
nullptr) {
79 if (new_throttle_data ==
nullptr)
return;
80 *throttle_data = new_throttle_data;
126 it == map_.end() ? nullptr :
it->second.get();
127 if (throttle_data ==
nullptr ||
132 MakeRefCounted<ServerRetryThrottleData>(
133 max_milli_tokens, milli_token_ratio, throttle_data))
135 throttle_data =
it->second.get();
137 return throttle_data->
Ref();
intptr_t milli_token_ratio() const
ServerRetryThrottleData(intptr_t max_milli_tokens, intptr_t milli_token_ratio, ServerRetryThrottleData *old_throttle_data)
bool RecordFailure()
Records a failure. Returns true if it's okay to send a retry.
static ServerRetryThrottleMap * Get()
#define gpr_atm_acq_load(p)
gpr_atm gpr_atm_no_barrier_clamped_add(gpr_atm *value, gpr_atm delta, gpr_atm min, gpr_atm max)
#define gpr_atm_rel_store(p, value)
RefCountedPtr< ServerRetryThrottleData > GetDataForServer(const std::string &server_name, intptr_t max_milli_tokens, intptr_t milli_token_ratio)
Global map of server name to retry throttle data.
const intptr_t max_milli_tokens_
Tracks retry throttling data for an individual server name.
const intptr_t milli_token_ratio_
void RecordSuccess()
Records a success.
intptr_t max_milli_tokens() const
~ServerRetryThrottleData() override
RefCountedPtr< ServerRetryThrottleData > Ref() GRPC_MUST_USE_RESULT
void GetReplacementThrottleDataIfNeeded(ServerRetryThrottleData **throttle_data)
grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:05