Confusion/name conflict between NameNodeActivity#BlockReportNumOps and RpcDetailedActivity#BlockReportNumOps. Contributed by Erik Krogen.

This commit is contained in:
Zhe Zhang 2017-06-21 16:34:19 -07:00
parent e806c6e0ce
commit c22cf00442
5 changed files with 15 additions and 21 deletions

View File

@ -2436,7 +2436,7 @@ public boolean processReport(final DatanodeID nodeID,
// Log the block report processing stats from Namenode perspective
final NameNodeMetrics metrics = NameNode.getNameNodeMetrics();
if (metrics != null) {
metrics.addBlockReport((int) (endTime - startTime));
metrics.addStorageBlockReport((int) (endTime - startTime));
}
blockLog.info("BLOCK* processReport 0x{}: from storage {} node {}, " +
"blocks: {}, hasStaleStorage: {}, processing time: {} msecs, " +

View File

@ -1486,7 +1486,6 @@ public Boolean call() throws IOException {
blocks, context);
}
});
metrics.incrStorageBlockReportOps();
}
bm.removeBRLeaseIfNeeded(nodeReg, context);

View File

@ -74,8 +74,6 @@ public class NameNodeMetrics {
MutableCounterLong snapshotDiffReportOps;
@Metric("Number of blockReceivedAndDeleted calls")
MutableCounterLong blockReceivedAndDeletedOps;
@Metric("Number of blockReports from individual storages")
MutableCounterLong storageBlockReportOps;
@Metric("Number of blockReports and blockReceivedAndDeleted queued")
MutableGaugeInt blockOpsQueued;
@Metric("Number of blockReports and blockReceivedAndDeleted batch processed")
@ -111,8 +109,9 @@ public long totalFileOps(){
final MutableQuantiles[] syncsQuantiles;
@Metric("Journal transactions batched in sync")
MutableCounterLong transactionsBatchedInSync;
@Metric("Block report") MutableRate blockReport;
final MutableQuantiles[] blockReportQuantiles;
@Metric("Number of blockReports from individual storages")
MutableRate storageBlockReport;
final MutableQuantiles[] storageBlockReportQuantiles;
@Metric("Cache report") MutableRate cacheReport;
final MutableQuantiles[] cacheReportQuantiles;
@Metric("Generate EDEK time") private MutableRate generateEDEKTime;
@ -143,7 +142,7 @@ public long totalFileOps(){
final int len = intervals.length;
syncsQuantiles = new MutableQuantiles[len];
blockReportQuantiles = new MutableQuantiles[len];
storageBlockReportQuantiles = new MutableQuantiles[len];
cacheReportQuantiles = new MutableQuantiles[len];
generateEDEKTimeQuantiles = new MutableQuantiles[len];
warmUpEDEKTimeQuantiles = new MutableQuantiles[len];
@ -154,9 +153,9 @@ public long totalFileOps(){
syncsQuantiles[i] = registry.newQuantiles(
"syncs" + interval + "s",
"Journal syncs", "ops", "latency", interval);
blockReportQuantiles[i] = registry.newQuantiles(
"blockReport" + interval + "s",
"Block report", "ops", "latency", interval);
storageBlockReportQuantiles[i] = registry.newQuantiles(
"storageBlockReport" + interval + "s",
"Storage block report", "ops", "latency", interval);
cacheReportQuantiles[i] = registry.newQuantiles(
"cacheReport" + interval + "s",
"Cache report", "ops", "latency", interval);
@ -284,10 +283,6 @@ public void incrSnapshotDiffReportOps() {
public void incrBlockReceivedAndDeletedOps() {
blockReceivedAndDeletedOps.incr();
}
public void incrStorageBlockReportOps() {
storageBlockReportOps.incr();
}
public void setBlockOpsQueued(int size) {
blockOpsQueued.set(size);
@ -316,9 +311,9 @@ public void setFsImageLoadTime(long elapsed) {
fsImageLoadTime.set((int) elapsed);
}
public void addBlockReport(long latency) {
blockReport.add(latency);
for (MutableQuantiles q : blockReportQuantiles) {
public void addStorageBlockReport(long latency) {
storageBlockReport.add(latency);
for (MutableQuantiles q : storageBlockReportQuantiles) {
q.add(latency);
}
}

View File

@ -216,8 +216,8 @@ public void testInitializeReplQueuesEarly() throws Exception {
GenericTestUtils.waitFor(new Supplier<Boolean>() {
@Override
public Boolean get() {
return getLongCounter("StorageBlockReportOps", getMetrics(NN_METRICS)) ==
cluster.getStoragesPerDatanode();
return getLongCounter("StorageBlockReportNumOps",
getMetrics(NN_METRICS)) == cluster.getStoragesPerDatanode();
}
}, 10, 10000);

View File

@ -781,7 +781,7 @@ public void testSyncAndBlockReportMetric() throws Exception {
// We have one sync when the cluster starts up, just opening the journal
assertCounter("SyncsNumOps", 3L, rb);
// Each datanode reports in when the cluster comes up
assertCounter("BlockReportNumOps",
assertCounter("StorageBlockReportNumOps",
(long) DATANODE_COUNT * cluster.getStoragesPerDatanode(), rb);
// Sleep for an interval+slop to let the percentiles rollover
@ -789,7 +789,7 @@ public void testSyncAndBlockReportMetric() throws Exception {
// Check that the percentiles were updated
assertQuantileGauges("Syncs1s", rb);
assertQuantileGauges("BlockReport1s", rb);
assertQuantileGauges("StorageBlockReport1s", rb);
}
/**