Copilot commented on code in PR #7000:
URL: https://github.com/apache/hbase/pull/7000#discussion_r2095818581
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/DefaultOperationQuota.java:
##########
@@ -288,4 +309,25 @@ private long calculateWriteCapacityUnitDiff(final long
actualSize, final long es
private long calculateReadCapacityUnitDiff(final long actualSize, final long
estimateSize) {
return calculateReadCapacityUnit(actualSize) -
calculateReadCapacityUnit(estimateSize);
}
+
+ private long calculateHandlerUsageTimeEstimate(final double
requestsPerSecond,
+ final int numHandlerThreads) {
+ if (requestsPerSecond <= numHandlerThreads) {
+ // If less than 1 request per second per handler thread, then we use the
number of handler
+ // threads as a baseline to avoid incorrect estimations when the number
of requests is very
+ // low.
+ return numHandlerThreads;
+ } else {
+ double requestsPerMillisecond = Math.ceil(requestsPerSecond / 1000);
Review Comment:
[nitpick] Consider adding documentation or comments to clarify the rationale
for using Math.ceil(requestsPerSecond/1000) for estimating per-request handler
usage time, ensuring it aligns with the intended behavior under low request
rates.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]