HDFS-16181. [SBN Read] Fix display of JournalNode metric RpcRequestCacheMissAmount (#3317)
Co-authored-by: wangzhaohui8 <wangzhaohui8@jd.com>
This commit is contained in:
parent
b8f7c7527a
commit
3ecaa39668
|
@ -773,7 +773,7 @@ public class Journal implements Closeable {
|
||||||
.setEditLog(output.toByteString())
|
.setEditLog(output.toByteString())
|
||||||
.build();
|
.build();
|
||||||
} catch (JournaledEditsCache.CacheMissException cme) {
|
} catch (JournaledEditsCache.CacheMissException cme) {
|
||||||
metrics.rpcRequestCacheMissAmount.add(cme.getCacheMissAmount());
|
metrics.addRpcRequestCacheMissAmount(cme.getCacheMissAmount());
|
||||||
throw cme;
|
throw cme;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,12 +51,7 @@ class JournalMetrics {
|
||||||
@Metric("Number of bytes served via RPC")
|
@Metric("Number of bytes served via RPC")
|
||||||
MutableCounterLong bytesServedViaRpc;
|
MutableCounterLong bytesServedViaRpc;
|
||||||
|
|
||||||
@Metric
|
private MutableStat rpcRequestCacheMissAmount;
|
||||||
MutableStat rpcRequestCacheMissAmount = new MutableStat(
|
|
||||||
"RpcRequestCacheMissAmount", "Number of RPC requests unable to be " +
|
|
||||||
"served due to lack of availability in cache, and how many " +
|
|
||||||
"transactions away the request was from being in the cache.",
|
|
||||||
"Misses", "Txns");
|
|
||||||
|
|
||||||
@Metric("Number of RPC requests with zero edits returned")
|
@Metric("Number of RPC requests with zero edits returned")
|
||||||
MutableCounterLong rpcEmptyResponses;
|
MutableCounterLong rpcEmptyResponses;
|
||||||
|
@ -87,6 +82,11 @@ class JournalMetrics {
|
||||||
"syncs" + interval + "s",
|
"syncs" + interval + "s",
|
||||||
"Journal sync time", "ops", "latencyMicros", interval);
|
"Journal sync time", "ops", "latencyMicros", interval);
|
||||||
}
|
}
|
||||||
|
rpcRequestCacheMissAmount = registry
|
||||||
|
.newStat("RpcRequestCacheMissAmount", "Number of RPC requests unable to be " +
|
||||||
|
"served due to lack of availability in cache, and how many " +
|
||||||
|
"transactions away the request was from being in the cache.",
|
||||||
|
"Misses", "Txns");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JournalMetrics create(Journal j) {
|
public static JournalMetrics create(Journal j) {
|
||||||
|
@ -149,4 +149,8 @@ class JournalMetrics {
|
||||||
public void incrNumEditLogsSynced() {
|
public void incrNumEditLogsSynced() {
|
||||||
numEditLogsSynced.incr();
|
numEditLogsSynced.incr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addRpcRequestCacheMissAmount(long cacheMissAmount) {
|
||||||
|
rpcRequestCacheMissAmount.add(cacheMissAmount);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue