[ 
https://issues.apache.org/jira/browse/HDFS-11657?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yiqun Lin updated HDFS-11657:
-----------------------------
    Attachment: HDFS-11657-HDFS-7240.001.patch

When working on adding the unit test, I found one bug in {{ContainerMetrics}}. 
The current container type is from {{1}} ~ {{17}}, but it's not initialized 
correctly in {{ContainerMetrics}} constructor method.
{code}
for (int i = 0; i < numEnumEntries; i++) {
      numOpsArray[i] = registry.newCounter(
          "num" + ContainerProtos.Type.valueOf(i),   <==== here var 'i' should 
be 'i+1' since the value of type is range from 1 rather than 0. This will let 
the counter value of metric isn't corresponding to its name. 
...
}
{code}

Attach the patch with also fixing the bug found above. Thanks for the review.

> Ozone: Add unit test for storage container metrics
> --------------------------------------------------
>
>                 Key: HDFS-11657
>                 URL: https://issues.apache.org/jira/browse/HDFS-11657
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: ozone, test
>    Affects Versions: HDFS-7240
>            Reporter: Yiqun Lin
>            Assignee: Yiqun Lin
>         Attachments: HDFS-11657-HDFS-7240.001.patch
>
>
> We need one additional unit test specified for storage contained metrics that 
> introduced in HDFS-11463. We can add test methods under this test class if we 
> add other container metrics in the future.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to