HDFS-7491. Add incremental blockreport latency to DN metrics. Contributed by Ming Ma.

(cherry picked from commit fb34f45727)
This commit is contained in:
cnauroth 2015-03-11 14:11:19 -07:00
parent d29cf296cb
commit 5e99b7cd2f
5 changed files with 14 additions and 0 deletions

View File

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

View File

@ -435,6 +435,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.

View File

@ -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) {

View File

@ -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);
} }

View File

@ -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();}
} }