aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/bucket_quoter
diff options
context:
space:
mode:
authorCthulhu <cthulhu@yandex-team.ru>2022-02-10 16:47:44 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:44 +0300
commitbcb3e9d0eb2a8188a6a9fe0907a8949ce4881a4e (patch)
tree09f7d6526ac5428ea224cd3cf7bd79809d8e6a07 /library/cpp/bucket_quoter
parent7b82c914c2f468dd50a208ff6a00d38ee7f0018f (diff)
downloadydb-bcb3e9d0eb2a8188a6a9fe0907a8949ce4881a4e.tar.gz
Restoring authorship annotation for Cthulhu <cthulhu@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/bucket_quoter')
-rw-r--r--library/cpp/bucket_quoter/bucket_quoter.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/library/cpp/bucket_quoter/bucket_quoter.h b/library/cpp/bucket_quoter/bucket_quoter.h
index 3d92ef8450..e641b654c7 100644
--- a/library/cpp/bucket_quoter/bucket_quoter.h
+++ b/library/cpp/bucket_quoter/bucket_quoter.h
@@ -82,12 +82,12 @@ public:
/* fixed quota */
TBucketQuoter(ui64 inflow, ui64 capacity, StatCounter* msgPassed = nullptr,
StatCounter* bucketUnderflows = nullptr, StatCounter* tokensUsed = nullptr,
- StatCounter* usecWaited = nullptr, bool fill = false, StatCounter* aggregateInflow = nullptr)
+ StatCounter* usecWaited = nullptr, bool fill = false, StatCounter* aggregateInflow = nullptr)
: MsgPassed(msgPassed)
, BucketUnderflows(bucketUnderflows)
, TokensUsed(tokensUsed)
, UsecWaited(usecWaited)
- , AggregateInflow(aggregateInflow)
+ , AggregateInflow(aggregateInflow)
, Bucket(fill ? capacity : 0)
, LastAdd(Timer::Now())
, InflowTokensPerSecond(&FixedInflow)
@@ -101,12 +101,12 @@ public:
/* adjustable quotas */
TBucketQuoter(TAtomic* inflow, TAtomic* capacity, StatCounter* msgPassed = nullptr,
StatCounter* bucketUnderflows = nullptr, StatCounter* tokensUsed = nullptr,
- StatCounter* usecWaited = nullptr, bool fill = false, StatCounter* aggregateInflow = nullptr)
+ StatCounter* usecWaited = nullptr, bool fill = false, StatCounter* aggregateInflow = nullptr)
: MsgPassed(msgPassed)
, BucketUnderflows(bucketUnderflows)
, TokensUsed(tokensUsed)
, UsecWaited(usecWaited)
- , AggregateInflow(aggregateInflow)
+ , AggregateInflow(aggregateInflow)
, Bucket(fill ? AtomicGet(*capacity) : 0)
, LastAdd(Timer::Now())
, InflowTokensPerSecond(inflow)
@@ -231,11 +231,11 @@ private:
ui64 elapsed = Timer::Duration(LastAdd, now);
if (*InflowTokensPerSecond * elapsed >= Timer::Resolution) {
- ui64 inflow = *InflowTokensPerSecond * elapsed / Timer::Resolution;
- if (AggregateInflow) {
- *AggregateInflow += inflow;
- }
- Bucket += inflow;
+ ui64 inflow = *InflowTokensPerSecond * elapsed / Timer::Resolution;
+ if (AggregateInflow) {
+ *AggregateInflow += inflow;
+ }
+ Bucket += inflow;
if (Bucket > *BucketTokensCapacity) {
Bucket = *BucketTokensCapacity;
}
@@ -267,7 +267,7 @@ private:
StatCounter* BucketUnderflows;
StatCounter* TokensUsed;
StatCounter* UsecWaited;
- StatCounter* AggregateInflow;
+ StatCounter* AggregateInflow;
i64 Bucket;
TTime LastAdd;