balodesecurity opened a new pull request, #8317:
URL: https://github.com/apache/hadoop/pull/8317

   ## Summary
   
   `DataNodeMetrics` already tracks `WritesFromLocalClient` / 
`WritesFromRemoteClient` (count only) and `RemoteBytesRead` / 
`RemoteBytesWritten` (bytes), but there is no byte-level metric for **local** 
client reads/writes.
   
   This patch adds two new `MutableCounterLong` metrics:
   
   | Metric | Description |
   |---|---|
   | `LocalBytesRead` | Bytes read by local (same-host) clients |
   | `LocalBytesWritten` | Bytes written by local (same-host) clients |
   
   These are incremented in `incrReadsFromClient(boolean local, long size)` and 
`incrWritesFromClient(boolean local, long size)` alongside the existing 
remote-bytes counters, so no call-site changes are required.
   
   ## Changes
   
   - `DataNodeMetrics.java` — added `localBytesRead` / `localBytesWritten` 
fields and updated `incrReadsFromClient` / `incrWritesFromClient` to increment 
them
   - `TestDataNodeMetrics.java` — added `testLocalBytesMetrics` which spins up 
a `MiniDFSCluster`, writes then reads a file from the local client, and asserts 
both new counters are positive while the remote-bytes counters remain zero
   
   ## Testing
   
   | Test class | Test method | Result | Duration |
   |---|---|---|---|
   | `TestDataNodeMetrics` | `testLocalBytesMetrics` | PASSED | 2.391 s |


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

Reply via email to