dlmarion commented on code in PR #6041:
URL: https://github.com/apache/accumulo/pull/6041#discussion_r2673158747


##########
server/tserver/src/main/java/org/apache/accumulo/tserver/TabletClientHandler.java:
##########
@@ -447,15 +449,15 @@ private void flush(UpdateSession us) {
     us.totalUpdates += mutationCount;
   }
 
-  private void updateAverageLockTime(long time, TimeUnit unit, int size) {
+  private void updateAverageLockTime(Duration duration, int size) {
     if (size > 0) {
-      server.updateMetrics.addLockTime((long) (time / (double) size), unit);
+      server.updateMetrics.addLockTime(duration.dividedBy(size));

Review Comment:
   I agree that it's converted to a duration later, I'm just suggesting that we 
could produce fewer objects along the way and revert to the older code.
   
   It's related to metrics, but the thread of execution is in an RPC call from 
the client when using a conditional update. IIRC (I haven't looked), this is 
what all of the tablet servers are using when they update the metadata table 
with conditional mutations. This will pollute the heap with a bunch of 
BigDecimal objects on the TabletServers that are hosting the metadata tablets 
and introduce a small delay into processing the RPC.



-- 
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]

Reply via email to