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 |
|
| `HeartbeatsAvgTime` | Average heartbeat time in milliseconds |
|
||||||
| `BlockReportsNumOps` | Total number of block report operations |
|
| `BlockReportsNumOps` | Total number of block report operations |
|
||||||
| `BlockReportsAvgTime` | Average time of block report operations in milliseconds |
|
| `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 |
|
| `CacheReportsNumOps` | Total number of cache report operations |
|
||||||
| `CacheReportsAvgTime` | Average time of cache report operations in milliseconds |
|
| `CacheReportsAvgTime` | Average time of cache report operations in milliseconds |
|
||||||
| `PacketAckRoundTripTimeNanosNumOps` | Total number of ack round trip |
|
| `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
|
HDFS-6806. HDFS Rolling upgrade document should mention the versions
|
||||||
available. (J.Andreina via aajisaka)
|
available. (J.Andreina via aajisaka)
|
||||||
|
|
||||||
|
HDFS-7491. Add incremental blockreport latency to DN metrics.
|
||||||
|
(Ming Ma via cnauroth)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
HDFS-7454. Reduce memory footprint for AclEntries in NameNode.
|
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
|
// Send incremental block reports to the Namenode outside the lock
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
|
final long startTime = Time.monotonicNow();
|
||||||
try {
|
try {
|
||||||
bpNamenode.blockReceivedAndDeleted(bpRegistration,
|
bpNamenode.blockReceivedAndDeleted(bpRegistration,
|
||||||
bpos.getBlockPoolId(),
|
bpos.getBlockPoolId(),
|
||||||
reports.toArray(new StorageReceivedDeletedBlocks[reports.size()]));
|
reports.toArray(new StorageReceivedDeletedBlocks[reports.size()]));
|
||||||
success = true;
|
success = true;
|
||||||
} finally {
|
} finally {
|
||||||
|
dn.getMetrics().addIncrementalBlockReport(Time.monotonicNow()-startTime);
|
||||||
if (!success) {
|
if (!success) {
|
||||||
synchronized (pendingIncrementalBRperStorage) {
|
synchronized (pendingIncrementalBRperStorage) {
|
||||||
for (StorageReceivedDeletedBlocks report : reports) {
|
for (StorageReceivedDeletedBlocks report : reports) {
|
||||||
|
|
|
@ -107,6 +107,7 @@ public class DataNodeMetrics {
|
||||||
@Metric MutableRate replaceBlockOp;
|
@Metric MutableRate replaceBlockOp;
|
||||||
@Metric MutableRate heartbeats;
|
@Metric MutableRate heartbeats;
|
||||||
@Metric MutableRate blockReports;
|
@Metric MutableRate blockReports;
|
||||||
|
@Metric MutableRate incrementalBlockReports;
|
||||||
@Metric MutableRate cacheReports;
|
@Metric MutableRate cacheReports;
|
||||||
@Metric MutableRate packetAckRoundTripTimeNanos;
|
@Metric MutableRate packetAckRoundTripTimeNanos;
|
||||||
final MutableQuantiles[] packetAckRoundTripTimeNanosQuantiles;
|
final MutableQuantiles[] packetAckRoundTripTimeNanosQuantiles;
|
||||||
|
@ -201,6 +202,10 @@ public class DataNodeMetrics {
|
||||||
blockReports.add(latency);
|
blockReports.add(latency);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addIncrementalBlockReport(long latency) {
|
||||||
|
incrementalBlockReports.add(latency);
|
||||||
|
}
|
||||||
|
|
||||||
public void addCacheReport(long latency) {
|
public void addCacheReport(long latency) {
|
||||||
cacheReports.add(latency);
|
cacheReports.add(latency);
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,6 +72,8 @@ public class TestDataNodeMetrics {
|
||||||
DataNode datanode = datanodes.get(0);
|
DataNode datanode = datanodes.get(0);
|
||||||
MetricsRecordBuilder rb = getMetrics(datanode.getMetrics().name());
|
MetricsRecordBuilder rb = getMetrics(datanode.getMetrics().name());
|
||||||
assertCounter("BytesWritten", LONG_FILE_LEN, rb);
|
assertCounter("BytesWritten", LONG_FILE_LEN, rb);
|
||||||
|
assertTrue("Expected non-zero number of incremental block reports",
|
||||||
|
getLongCounter("IncrementalBlockReportsNumOps", rb) > 0);
|
||||||
} finally {
|
} finally {
|
||||||
if (cluster != null) {cluster.shutdown();}
|
if (cluster != null) {cluster.shutdown();}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue