MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / AdmitRequest

Method AdmitRequest

tensorflow/core/platform/cloud/gcs_throttle.cc:27–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25 env_time_(env_time) {}
26
27bool GcsThrottle::AdmitRequest() {
28 mutex_lock l(mu_);
29 UpdateState();
30 if (available_tokens_ < config_.tokens_per_request) {
31 return false || !config_.enabled;
32 }
33 available_tokens_ -= config_.tokens_per_request;
34 return true;
35}
36
37void GcsThrottle::RecordResponse(size_t num_bytes) {
38 mutex_lock l(mu_);

Callers 3

CreateHttpRequestMethod · 0.80
TEST_FFunction · 0.80
TESTFunction · 0.80

Calls

no outgoing calls

Tested by 2

TEST_FFunction · 0.64
TESTFunction · 0.64