HDFS-7491. Add incremental blockreport latency to DN metrics. Contributed by Ming Ma.
(cherry picked from commitfb34f45727
) (cherry picked from commit5e99b7cd2f
)
This commit is contained in:
parent
a5a933a9a0
commit
0fe5f5b5b8
|
@ -302,6 +302,8 @@ Each metrics record contains tags such as SessionId and Hostname as additional i
|
|||
| `HeartbeatsAvgTime` | Average heartbeat time in milliseconds |
|
||||
| `BlockReportsNumOps` | Total number of block report operations |
|
||||
| `BlockReportsAvgTime` | Average time of block report operations in milliseconds |
|
||||
| `IncrementalBlockReportsNumOps` | Total number of incremental block report operations |
|
||||
| `IncrementalBlockReportsAvgTime` | Average time of incremental block report operations in milliseconds |
|
||||
| `CacheReportsNumOps` | Total number of cache report operations |
|
||||
| `CacheReportsAvgTime` | Average time of cache report operations in milliseconds |
|
||||
| `PacketAckRoundTripTimeNanosNumOps` | Total number of ack round trip |
|
||||
|
|
|
@ -423,6 +423,9 @@ Release 2.7.0 - UNRELEASED
|
|||
HDFS-6806. HDFS Rolling upgrade document should mention the versions
|
||||
available. (J.Andreina via aajisaka)
|
||||
|
||||
HDFS-7491. Add incremental blockreport latency to DN metrics.
|
||||
(Ming Ma via cnauroth)
|
||||
|
||||
OPTIMIZATIONS
|
||||
|
||||
HDFS-7454. Reduce memory footprint for AclEntries in NameNode.
|
||||
|
|
|
@ -291,12 +291,14 @@ class BPServiceActor implements Runnable {
|
|||
|
||||
// Send incremental block reports to the Namenode outside the lock
|
||||
boolean success = false;
|
||||
final long startTime = Time.monotonicNow();
|
||||
try {
|
||||
bpNamenode.blockReceivedAndDeleted(bpRegistration,
|
||||
bpos.getBlockPoolId(),
|
||||
reports.toArray(new StorageReceivedDeletedBlocks[reports.size()]));
|
||||
success = true;
|
||||
} finally {
|
||||
dn.getMetrics().addIncrementalBlockReport(Time.monotonicNow()-startTime);
|
||||
if (!success) {
|
||||
synchronized (pendingIncrementalBRperStorage) {
|
||||
for (StorageReceivedDeletedBlocks report : reports) {
|
||||
|
|
|
@ -107,6 +107,7 @@ public class DataNodeMetrics {
|
|||
@Metric MutableRate replaceBlockOp;
|
||||
@Metric MutableRate heartbeats;
|
||||
@Metric MutableRate blockReports;
|
||||
@Metric MutableRate incrementalBlockReports;
|
||||
@Metric MutableRate cacheReports;
|
||||
@Metric MutableRate packetAckRoundTripTimeNanos;
|
||||
final MutableQuantiles[] packetAckRoundTripTimeNanosQuantiles;
|
||||
|
@ -201,6 +202,10 @@ public class DataNodeMetrics {
|
|||
blockReports.add(latency);
|
||||
}
|
||||
|
||||
public void addIncrementalBlockReport(long latency) {
|
||||
incrementalBlockReports.add(latency);
|
||||
}
|
||||
|
||||
public void addCacheReport(long latency) {
|
||||
cacheReports.add(latency);
|
||||
}
|
||||
|
|
|
@ -72,6 +72,8 @@ public class TestDataNodeMetrics {
|
|||
DataNode datanode = datanodes.get(0);
|
||||
MetricsRecordBuilder rb = getMetrics(datanode.getMetrics().name());
|
||||
assertCounter("BytesWritten", LONG_FILE_LEN, rb);
|
||||
assertTrue("Expected non-zero number of incremental block reports",
|
||||
getLongCounter("IncrementalBlockReportsNumOps", rb) > 0);
|
||||
} finally {
|
||||
if (cluster != null) {cluster.shutdown();}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue