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

Method UpdateState

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

Source from the content-addressed store, hash-verified

48}
49
50void GcsThrottle::UpdateState() {
51 // TODO(b/72643279): Switch to a monotonic clock.
52 int64 now = env_time_->NowSeconds();
53 uint64 delta_secs =
54 std::max(int64{0}, now - static_cast<int64>(last_updated_secs_));
55 available_tokens_ += delta_secs * config_.token_rate;
56 available_tokens_ = std::min(available_tokens_, config_.bucket_size);
57 last_updated_secs_ = now;
58}
59
60} // namespace tensorflow

Callers

nothing calls this directly

Calls 3

maxFunction · 0.50
minFunction · 0.50
NowSecondsMethod · 0.45

Tested by

no test coverage detected