| 7180 | } |
| 7181 | |
| 7182 | double 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 | |
| 7201 | uint32_t Transaction::getSize() { |
| 7202 | auto s = tr.transaction.mutations.expectedSize() + tr.transaction.read_conflict_ranges.expectedSize() + |
no test coverage detected