HDFS-9882. Add heartbeatsTotal in Datanode metrics. (Contributed by Hua Liu)
This commit is contained in:
parent
47f884e06a
commit
a63f1039f9
|
@ -291,6 +291,8 @@ Each metrics record contains tags such as SessionId and Hostname as additional i
|
|||
| `ReplaceBlockOpAvgTime` | Average time of block replace operations in milliseconds |
|
||||
| `HeartbeatsNumOps` | Total number of heartbeats |
|
||||
| `HeartbeatsAvgTime` | Average heartbeat time in milliseconds |
|
||||
| `HeartbeatsTotalNumOps` | Total number of heartbeats which is a duplicate of HeartbeatsNumOps |
|
||||
| `HeartbeatsTotalAvgTime` | Average total heartbeat time in milliseconds |
|
||||
| `LifelinesNumOps` | Total number of lifeline messages |
|
||||
| `LifelinesAvgTime` | Average lifeline message processing time in milliseconds |
|
||||
| `BlockReportsNumOps` | Total number of block report operations |
|
||||
|
|
|
@ -607,6 +607,11 @@ class BPServiceActor implements Runnable {
|
|||
processCommand(new DatanodeCommand[]{ cmd });
|
||||
}
|
||||
|
||||
if (sendHeartbeat) {
|
||||
dn.getMetrics().addHeartbeatTotal(
|
||||
scheduler.monotonicNow() - startTime);
|
||||
}
|
||||
|
||||
// There is no work to do; sleep until hearbeat timer elapses,
|
||||
// or work arrives, and then iterate again.
|
||||
ibrManager.waitTillNextIBR(scheduler.getHeartbeatWaitTime());
|
||||
|
|
|
@ -107,6 +107,7 @@ public class DataNodeMetrics {
|
|||
@Metric MutableRate copyBlockOp;
|
||||
@Metric MutableRate replaceBlockOp;
|
||||
@Metric MutableRate heartbeats;
|
||||
@Metric MutableRate heartbeatsTotal;
|
||||
@Metric MutableRate lifelines;
|
||||
@Metric MutableRate blockReports;
|
||||
@Metric MutableRate incrementalBlockReports;
|
||||
|
@ -200,6 +201,10 @@ public class DataNodeMetrics {
|
|||
heartbeats.add(latency);
|
||||
}
|
||||
|
||||
public void addHeartbeatTotal(long latency) {
|
||||
heartbeatsTotal.add(latency);
|
||||
}
|
||||
|
||||
public void addLifeline(long latency) {
|
||||
lifelines.add(latency);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue