Skip to content
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

ZOOKEEPER-4863 Support reply error count metrics #2193

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 @@ -585,6 +585,8 @@ public void processRequest(Request request) {
err = Code.MARSHALLINGERROR;
}

updateReplyErrorCountMetrics(err);

ReplyHeader hdr = new ReplyHeader(request.cxid, lastZxid, err.intValue());

updateStats(request, lastOp, lastZxid);
Expand Down Expand Up @@ -626,6 +628,12 @@ public void processRequest(Request request) {
}
}

private void updateReplyErrorCountMetrics(Code errorCode) {
if (!Code.OK.equals(errorCode)) {
ServerMetrics.getMetrics().REPLY_ERROR_COUNT.add(errorCode.name(), 1);
}
}

private Record handleGetChildrenRequest(Record request, ServerCnxn cnxn, List<Id> authInfo) throws KeeperException, IOException {
GetChildrenRequest getChildrenRequest = (GetChildrenRequest) request;
String path = getChildrenRequest.getPath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ private ServerMetrics(MetricsProvider metricsProvider) {
JVM_PAUSE_TIME = metricsContext.getSummary("jvm_pause_time_ms", DetailLevel.ADVANCED);

QUOTA_EXCEEDED_ERROR_PER_NAMESPACE = metricsContext.getCounterSet(QuotaMetricsUtils.QUOTA_EXCEEDED_ERROR_PER_NAMESPACE);

REPLY_ERROR_COUNT = metricsContext.getCounterSet("reply_error_count");
}

/**
Expand Down Expand Up @@ -547,6 +549,8 @@ private ServerMetrics(MetricsProvider metricsProvider) {

public final CounterSet QUOTA_EXCEEDED_ERROR_PER_NAMESPACE;

public final CounterSet REPLY_ERROR_COUNT;

private final MetricsProvider metricsProvider;

public void resetAll() {
Expand Down