Skip to content

Conversation

@chungen0126
Copy link
Contributor

What changes were proposed in this pull request?

StorageContainerMetrics.incContainerOpsMetrics() updates operation counts. It is incremented not just once for WriteChunk, because it is called by HddsDispatcher.dispatchRequest() during WRITE_DATA (by ContainerStateMachine.writeStateMachineData()) and COMMIT_DATA phase.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-10907

How was this patch tested?

Add assertion of containerMetrics in TestBlockOutputStream

@chungen0126 chungen0126 deleted the HDDS-10907 branch June 20, 2024 10:01
@chungen0126 chungen0126 restored the HDDS-10907 branch June 20, 2024 10:02
@chungen0126 chungen0126 reopened this Jun 20, 2024
@chungen0126
Copy link
Contributor Author

It seem that adding the test in TestContainerMetrics is better. I'll update it later.

ContainerCommandResponseProto response =
client.sendCommand(writeChunkRequest);
ContainerCommandResponseProto response = client.sendCommand(writeChunkRequest);
assertEquals(ContainerProtos.Result.SUCCESS,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should check the related metrics in containerMetrics are correct. In specific, make sure numWriteChunk is expected.

Copy link
Contributor Author

@chungen0126 chungen0126 Jun 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are some assertions for containerMetrics:

assertCounter("NumOps", 3L, containerMetrics);
assertCounter("numCreateContainer", 1L, containerMetrics);
assertCounter("numWriteChunk", 1L, containerMetrics);
assertCounter("numReadChunk", 1L, containerMetrics);

Is it enough?

Copy link
Contributor

@jojochuang jojochuang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 merging it

@adoroszlai
Copy link
Contributor

@jojochuang CI passed, in case you want to merge

@jojochuang jojochuang merged commit 63a232b into apache:master Jul 16, 2024
xichen01 pushed a commit to xichen01/ozone that referenced this pull request Jul 26, 2024
… multiple times (apache#6835)

Co-authored-by: Doroszlai, Attila <adoroszlai@apache.org>

(cherry picked from commit 63a232b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants