HADOOP-10059. RPC authentication and authorization metrics overflow to negative values on busy clusters. Contributed by Tsuyoshi OZAWA and Akira AJISAKA

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1618659 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason Darrell Lowe 2014-08-18 16:31:38 +00:00
parent 08d6201b34
commit 4a978bff3e
3 changed files with 12 additions and 8 deletions

View File

@ -605,6 +605,10 @@ Release 2.6.0 - UNRELEASED
HADOOP-10964. Small fix for NetworkTopologyWithNodeGroup#sortByDistance. HADOOP-10964. Small fix for NetworkTopologyWithNodeGroup#sortByDistance.
(Yi Liu via wang) (Yi Liu via wang)
HADOOP-10059. RPC authentication and authorization metrics overflow to
negative values on busy clusters (Tsuyoshi OZAWA and Akira AJISAKA
via jlowe)
Release 2.5.0 - UNRELEASED Release 2.5.0 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -88,13 +88,13 @@ public class RpcMetrics {
@Metric("Processsing time") MutableRate rpcProcessingTime; @Metric("Processsing time") MutableRate rpcProcessingTime;
MutableQuantiles[] rpcProcessingTimeMillisQuantiles; MutableQuantiles[] rpcProcessingTimeMillisQuantiles;
@Metric("Number of authentication failures") @Metric("Number of authentication failures")
MutableCounterInt rpcAuthenticationFailures; MutableCounterLong rpcAuthenticationFailures;
@Metric("Number of authentication successes") @Metric("Number of authentication successes")
MutableCounterInt rpcAuthenticationSuccesses; MutableCounterLong rpcAuthenticationSuccesses;
@Metric("Number of authorization failures") @Metric("Number of authorization failures")
MutableCounterInt rpcAuthorizationFailures; MutableCounterLong rpcAuthorizationFailures;
@Metric("Number of authorization sucesses") @Metric("Number of authorization sucesses")
MutableCounterInt rpcAuthorizationSuccesses; MutableCounterLong rpcAuthorizationSuccesses;
@Metric("Number of open connections") public int numOpenConnections() { @Metric("Number of open connections") public int numOpenConnections() {
return server.getNumOpenConnections(); return server.getNumOpenConnections();

View File

@ -583,14 +583,14 @@ public class TestRPC {
} }
MetricsRecordBuilder rb = getMetrics(server.rpcMetrics.name()); MetricsRecordBuilder rb = getMetrics(server.rpcMetrics.name());
if (expectFailure) { if (expectFailure) {
assertCounter("RpcAuthorizationFailures", 1, rb); assertCounter("RpcAuthorizationFailures", 1L, rb);
} else { } else {
assertCounter("RpcAuthorizationSuccesses", 1, rb); assertCounter("RpcAuthorizationSuccesses", 1L, rb);
} }
//since we don't have authentication turned ON, we should see //since we don't have authentication turned ON, we should see
// 0 for the authentication successes and 0 for failure // 0 for the authentication successes and 0 for failure
assertCounter("RpcAuthenticationFailures", 0, rb); assertCounter("RpcAuthenticationFailures", 0L, rb);
assertCounter("RpcAuthenticationSuccesses", 0, rb); assertCounter("RpcAuthenticationSuccesses", 0L, rb);
} }
} }