yandrey321 commented on code in PR #9753:
URL: https://github.com/apache/ozone/pull/9753#discussion_r2799497477
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueHandler.java:
##########
@@ -2091,8 +2091,18 @@ public ContainerCommandResponseProto readBlock(
return malformedRequest(request);
}
try {
- readBlockImpl(request, blockFile, kvContainer, streamObserver, false);
- // TODO metrics.incContainerBytesStats(Type.ReadBlock,
readBlock.getLen());
+ final long startTime = Time.monotonicNow();
+ final long bytesRead = readBlockImpl(request, blockFile, kvContainer,
streamObserver, false);
+ long endTime = Time.monotonicNow();
+ KeyValueContainerData containerData = (KeyValueContainerData) kvContainer
+ .getContainerData();
+ HddsVolume volume = containerData.getVolume();
+ if (volume != null) {
+ volume.getVolumeIOStats().incReadTime(endTime - startTime);
Review Comment:
can it be done in a single call? for each read we had to update all these
metrics, there is no reason to do 3 separate calls
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]