Move expiredTagThrottleCleanup into TagThrottler class
This commit is contained in:
parent
eb5a556c98
commit
5c053c6c37
|
@ -475,8 +475,6 @@ Ratekeeper::Ratekeeper(UID id, Database db)
|
|||
SERVER_KNOBS->MAX_TL_SS_VERSION_DIFFERENCE_BATCH,
|
||||
SERVER_KNOBS->TARGET_DURABILITY_LAG_VERSIONS_BATCH) {
|
||||
tagThrottler = std::make_unique<TagThrottler>(db, id);
|
||||
expiredTagThrottleCleanup = recurring([this]() { ThrottleApi::expire(this->db.getReference()); },
|
||||
SERVER_KNOBS->TAG_THROTTLE_EXPIRED_CLEANUP_INTERVAL);
|
||||
}
|
||||
|
||||
void Ratekeeper::updateCommitCostEstimation(
|
||||
|
|
|
@ -150,8 +150,6 @@ class Ratekeeper {
|
|||
Deque<double> actualTpsHistory;
|
||||
Optional<Key> remoteDC;
|
||||
|
||||
Future<Void> expiredTagThrottleCleanup;
|
||||
|
||||
Ratekeeper(UID id, Database db);
|
||||
|
||||
Future<Void> configurationMonitor();
|
||||
|
|
|
@ -383,6 +383,7 @@ class TagThrottlerImpl {
|
|||
RkTagThrottleCollection throttledTags;
|
||||
uint64_t throttledTagChangeId{ 0 };
|
||||
bool autoThrottlingEnabled{ false };
|
||||
Future<Void> expiredTagThrottleCleanup;
|
||||
|
||||
ACTOR static Future<Void> monitorThrottlingChanges(TagThrottlerImpl* self) {
|
||||
state bool committed = false;
|
||||
|
@ -524,7 +525,10 @@ class TagThrottlerImpl {
|
|||
}
|
||||
|
||||
public:
|
||||
TagThrottlerImpl(Database db, UID id) : db(db), id(id) {}
|
||||
TagThrottlerImpl(Database db, UID id) : db(db), id(id) {
|
||||
expiredTagThrottleCleanup = recurring([this]() { ThrottleApi::expire(this->db.getReference()); },
|
||||
SERVER_KNOBS->TAG_THROTTLE_EXPIRED_CLEANUP_INTERVAL);
|
||||
}
|
||||
Future<Void> monitorThrottlingChanges() { return monitorThrottlingChanges(this); }
|
||||
|
||||
void addRequests(TransactionTag tag, int count) { throttledTags.addRequests(tag, count); }
|
||||
|
|
Loading…
Reference in New Issue