Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Vikas Choudhary (vikasc) <choudharyvikas16@gmail.com>
  • Loading branch information
vikaschoudhary16 committed Jan 18, 2025
1 parent 3463d28 commit 25aa2ab
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ void LocalRateLimiterImpl::onFillTimer() {
for (const auto& descriptor : descriptors_) {
descriptor.second->onFillTimer(refill_counter_, share_factor);
}
dynamic_descriptors_.onFillTimer(refill_counter_, share_factor);

fill_timer_->enableTimer(default_token_bucket_->fillInterval());
}
Expand Down Expand Up @@ -426,12 +425,6 @@ DynamicDescriptorMap::getBucket(const RateLimit::Descriptor request_descriptor)
return nullptr;
}

void DynamicDescriptorMap::onFillTimer(uint64_t refill_counter, double factor) {
for (const auto& pair : user_descriptors_) {
pair.second->onFillTimer(refill_counter, factor);
}
}

DynamicDescriptor::DynamicDescriptor(RateLimitTokenBucketSharedPtr token_bucket, uint32_t lru_size,
TimeSource& time_source)
: parent_token_bucket_(token_bucket), lru_size_(lru_size), time_source_(time_source) {}
Expand Down Expand Up @@ -475,13 +468,6 @@ DynamicDescriptor::addOrGetDescriptor(const RateLimit::Descriptor& request_descr
return result.first->second.first;
}

void DynamicDescriptor::onFillTimer(uint64_t refill_counter, double factor) {
absl::WriterMutexLock lock(&dyn_desc_lock_);
for (auto& pair : dynamic_descriptors_) {
pair.second.first->onFillTimer(refill_counter, factor);
}
}

} // namespace LocalRateLimit
} // namespace Common
} // namespace Filters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class DynamicDescriptor : public Logger::Loggable<Logger::Id::rate_limit_quota>
~DynamicDescriptor() = default;
// add a new user configured descriptor to the set.
RateLimitTokenBucketSharedPtr addOrGetDescriptor(const RateLimit::Descriptor& request_descriptor);
void onFillTimer(uint64_t refill_counter, double factor);

private:
RateLimitTokenBucketSharedPtr parent_token_bucket_;
Expand All @@ -57,7 +56,6 @@ class DynamicDescriptorMap : public Logger::Loggable<Logger::Id::rate_limit_quot
DynamicDescriptorSharedPtr dynamic_descriptor);
// pass request_descriptors to the dynamic descriptor set to get the token bucket.
RateLimitTokenBucketSharedPtr getBucket(const RateLimit::Descriptor);
void onFillTimer(uint64_t refill_counter, double factor);

private:
bool compareDescriptorEntries(const std::vector<RateLimit::DescriptorEntry>& request_entries,
Expand Down

0 comments on commit 25aa2ab

Please sign in to comment.