Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ Each metrics record contains tags such as ProcessName, SessionId, and Hostname a
| `EditLogTailIntervalAvgTime` | Average time of intervals between edit log tailings by standby NameNode in milliseconds |
| `EditLogTailInterval`*num*`s(50/75/90/95/99)thPercentileLatency` | The 50/75/90/95/99th percentile of time between edit log tailings by standby NameNode in milliseconds (*num* seconds granularity). Percentile measurement is off by default, by watching no intervals. The intervals are specified by `dfs.metrics.percentiles.intervals`. |
| `PendingEditsCount` | Current number of pending edits |
| `PendingSyncEditsCount` | Current number of pending sync edits |

FSNamesystem
------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ private Edit dequeueEdit() throws InterruptedException {
@Override
public void run() {
try {
NameNodeMetrics metrics = NameNode.getNameNodeMetrics();
while (true) {
NameNodeMetrics metrics = NameNode.getNameNodeMetrics();
boolean doSync;
Edit edit = dequeueEdit();
if (edit != null) {
Expand All @@ -258,6 +258,7 @@ public void run() {
doSync = !syncWaitQ.isEmpty();
metrics.setPendingEditsCount(0);
}
metrics.setPendingSyncEditsCount(syncWaitQ.size());
if (doSync) {
// normally edit log exceptions cause the NN to terminate, but tests
// relying on ExitUtil.terminate need to see the exception.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ public class NameNodeMetrics {
MutableCounterLong blockOpsBatched;
@Metric("Number of pending edits")
MutableGaugeInt pendingEditsCount;
@Metric("Number of pending sync edits")
MutableGaugeInt pendingSyncEditsCount;
@Metric("Number of delete blocks Queued")
MutableGaugeInt deleteBlocksQueued;
@Metric("Number of pending deletion blocks")
Expand Down Expand Up @@ -365,6 +367,10 @@ public void setPendingEditsCount(int size) {
pendingEditsCount.set(size);
}

public void setPendingSyncEditsCount(int size) {
pendingSyncEditsCount.set(size);
}

public void addTransaction(long latency) {
transactions.add(latency);
}
Expand Down