siddharthteotia commented on a change in pull request #4472: Use hit counter to
track max QPS per minute for broker
URL: https://github.com/apache/incubator-pinot/pull/4472#discussion_r308466844
##########
File path:
pinot-broker/src/main/java/org/apache/pinot/broker/queryquota/HitCounter.java
##########
@@ -77,11 +90,154 @@ public int getHitCount() {
int getHitCount(long timestamp) {
long numTimeUnits = timestamp / _timeBucketWidthMs;
int count = 0;
- for (int i = 0; i < BUCKET_COUNT; i++) {
- if (numTimeUnits - _bucketStartTime.get(i) < BUCKET_COUNT) {
+ for (int i = 0; i < _bucketCount; i++) {
+ if (numTimeUnits - _bucketStartTime.get(i) < _bucketCount) {
count += _bucketHitCount.get(i);
}
}
return count;
}
+
+ /*
+ * Explanation of algorithm to keep track of
+ * max QPS per minute:
Review comment:
yep, corrected it
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]