HDDS-10516. Add metrics for chunk read from internal ratis#6375
Merged
jojochuang merged 1 commit intoapache:masterfrom Mar 14, 2024
Merged
HDDS-10516. Add metrics for chunk read from internal ratis#6375jojochuang merged 1 commit intoapache:masterfrom
jojochuang merged 1 commit intoapache:masterfrom
Conversation
jojochuang
approved these changes
Mar 14, 2024
ashishkumar50
approved these changes
Mar 14, 2024
Contributor
ashishkumar50
left a comment
There was a problem hiding this comment.
Thanks @ChenSammi, LGTM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
add metrics for chunk read from internal ratis.
Currently, there are following metrics on every datanode for chunk reads.
"numReadChunk" : 136237,
"bytesReadChunk" : 1395066880,
"LatencyReadChunkNumOps" : 136237,
"LatencyReadChunkAvgTime" : 1.0,
The chunk read requests come from both remote user client and internal ratis if the datanode is the leader of the ratis group. Currently, we cannot tell how much data is read by user client, and how much data is read by ratis leader itself. So this task is to introduce a new set of following metrics for read by ratis,
numReadStateMachine // the request counts from ratis
bytesReadStateMachine // the total bytes read by ratis
So the final goal is we want to know how much data is read by user client. So for read from user client,
bytesReadChunk - bytesReadStateMachine = bytes read by user clients
numReadChunk - numReadStateMachine = request counts from user clients
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-10516
How was this patch tested?
Manual test.
ozone freon randomkeys --num-of-volumes=5 --num-of-buckets=2 --num-of-keys=10000 --replication-type=RATIS --replication=THREE --validate-writes --num-of-validate-threads=10
For leader datanode, it's bytesReadChunk equal to bytesReadStateMachine now.
And bytesReadChunk and bytesReadStateMachine are all 0 on other two follower datanodes.
5. Use "ozone fs -get" command to read several keys created by freon.
6. check both metrics again on leader Datanode, bytesReadChunk value is increased, while bytesReadStateMachine still remains the same.