MCPcopy Create free account
hub / github.com/apple/foundationdb / throttleDuration

Method throttleDuration

fdbclient/NativeAPI.actor.cpp:7182–7199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7180}
7181
7182double ClientTagThrottleData::throttleDuration() const {
7183 if (expiration <= now()) {
7184 return 0.0;
7185 }
7186
7187 double capacity =
7188 (smoothRate.smoothTotal() - smoothReleased.smoothRate()) * CLIENT_KNOBS->TAG_THROTTLE_SMOOTHING_WINDOW;
7189
7190 if (capacity >= 1) {
7191 return 0.0;
7192 }
7193
7194 if (tpsRate == 0) {
7195 return std::max(0.0, expiration - now());
7196 }
7197
7198 return std::min(expiration - now(), capacity / tpsRate);
7199}
7200
7201uint32_t Transaction::getSize() {
7202 auto s = tr.transaction.mutations.expectedSize() + tr.transaction.read_conflict_ranges.expectedSize() +

Callers 3

getBackoffMethod · 0.80
getReadVersionMethod · 0.80

Calls 3

nowFunction · 0.85
smoothTotalMethod · 0.80
smoothRateMethod · 0.45

Tested by

no test coverage detected