Skip to content

HDFS-16181. [SBN Read] Fix metric of RpcRequestCacheMissAmount can't display when tailEditLog form JN #3317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 15, 2021
Merged
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 @@ -773,7 +773,7 @@ public GetJournaledEditsResponseProto getJournaledEdits(long sinceTxId,
.setEditLog(output.toByteString())
.build();
} catch (JournaledEditsCache.CacheMissException cme) {
metrics.rpcRequestCacheMissAmount.add(cme.getCacheMissAmount());
metrics.addRpcRequestCacheMissAmount(cme.getCacheMissAmount());
throw cme;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,7 @@ class JournalMetrics {
@Metric("Number of bytes served via RPC")
MutableCounterLong bytesServedViaRpc;

@Metric
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");
private MutableStat rpcRequestCacheMissAmount;

@Metric("Number of RPC requests with zero edits returned")
MutableCounterLong rpcEmptyResponses;
Expand Down Expand Up @@ -87,6 +82,11 @@ class JournalMetrics {
"syncs" + interval + "s",
"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) {
Expand Down Expand Up @@ -149,4 +149,8 @@ public MutableCounterLong getNumEditLogsSynced() {
public void incrNumEditLogsSynced() {
numEditLogsSynced.incr();
}

public void addRpcRequestCacheMissAmount(long cacheMissAmount) {
rpcRequestCacheMissAmount.add(cacheMissAmount);
}
}