This is an automated email from the ASF dual-hosted git repository.
jlowe pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new c634589 Revert "HDFS-14084. Need for more stats in DFSClient.
Contributed by Pranay Singh."
c634589 is described below
commit c634589ab2d602bf80ba513f88d44544e9bedcb5
Author: Jason Lowe <[email protected]>
AuthorDate: Wed Jan 9 17:24:58 2019 -0600
Revert "HDFS-14084. Need for more stats in DFSClient. Contributed by Pranay
Singh."
This reverts commit ecdeaa7e6ad43555031aed032e6ba7a14a17d7bc.
---
.../main/java/org/apache/hadoop/ipc/Client.java | 25 ----------------------
.../org/apache/hadoop/ipc/ProtobufRpcEngine.java | 16 +++-----------
.../hadoop/ipc/metrics/RpcDetailedMetrics.java | 12 ++++-------
3 files changed, 7 insertions(+), 46 deletions(-)
diff --git
a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
index 124d068..ea79887 100644
---
a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
+++
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
@@ -34,7 +34,6 @@ import org.apache.hadoop.io.WritableUtils;
import org.apache.hadoop.io.retry.RetryPolicies;
import org.apache.hadoop.io.retry.RetryPolicy;
import org.apache.hadoop.io.retry.RetryPolicy.RetryAction;
-import org.apache.hadoop.ipc.metrics.RpcDetailedMetrics;
import org.apache.hadoop.ipc.RPC.RpcKind;
import org.apache.hadoop.ipc.Server.AuthProtocol;
import
org.apache.hadoop.ipc.protobuf.IpcConnectionContextProtos.IpcConnectionContextProto;
@@ -87,7 +86,6 @@ import static org.apache.hadoop.ipc.RpcConstants.PING_CALL_ID;
public class Client implements AutoCloseable {
public static final Logger LOG = LoggerFactory.getLogger(Client.class);
- private final RpcDetailedMetrics rpcDetailedMetrics;
/** A counter for generating call IDs. */
private static final AtomicInteger callIdCounter = new AtomicInteger();
@@ -211,24 +209,6 @@ public class Client implements AutoCloseable {
};
/**
- * Update a particular metric by recording the processing
- * time of the metric.
- *
- * @param name Metric name
- * @param processingTime time spent in processing the metric.
- */
- public void updateMetrics(String name, long processingTime) {
- rpcDetailedMetrics.addProcessingTime(name, processingTime);
- }
-
- /**
- * Get the RpcDetailedMetrics associated with the Client.
- */
- public RpcDetailedMetrics getRpcDetailedMetrics() {
- return rpcDetailedMetrics;
- }
-
- /**
* set the ping interval value in configuration
*
* @param conf Configuration
@@ -1334,11 +1314,6 @@ public class Client implements AutoCloseable {
this.maxAsyncCalls = conf.getInt(
CommonConfigurationKeys.IPC_CLIENT_ASYNC_CALLS_MAX_KEY,
CommonConfigurationKeys.IPC_CLIENT_ASYNC_CALLS_MAX_DEFAULT);
- /**
- * Create with port of -1, dummy port since the function
- * takes default argument.
- */
- this.rpcDetailedMetrics = RpcDetailedMetrics.create(-1);
}
/**
diff --git
a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/ProtobufRpcEngine.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/ProtobufRpcEngine.java
index e52dc66..5548566 100644
---
a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/ProtobufRpcEngine.java
+++
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/ProtobufRpcEngine.java
@@ -49,8 +49,6 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
-import org.apache.hadoop.metrics2.MetricStringBuilder;
-import org.apache.hadoop.metrics2.lib.MutableRatesWithAggregation;
/**
* RPC Engine for for protobuf based RPCs.
@@ -197,7 +195,7 @@ public class ProtobufRpcEngine implements RpcEngine {
throws ServiceException {
long startTime = 0;
if (LOG.isDebugEnabled()) {
- startTime = System.currentTimeMillis();
+ startTime = Time.now();
}
if (args.length != 2) { // RpcController + Message
@@ -252,16 +250,8 @@ public class ProtobufRpcEngine implements RpcEngine {
}
if (LOG.isDebugEnabled()) {
- long callTime = System.currentTimeMillis() - startTime;
- if (callTime > 0) {
- MetricStringBuilder rb =
- new MetricStringBuilder(null, "", " = ", "\n");
- client.updateMetrics(method.getName(), callTime);
- MutableRatesWithAggregation rates =
- client.getRpcDetailedMetrics().getMutableRates();
- rates.snapshot(rb, true);
- LOG.debug("RPC Client stats: {}", rb);
- }
+ long callTime = Time.now() - startTime;
+ LOG.debug("Call: " + method.getName() + " took " + callTime + "ms");
}
if (Client.isAsynchronousMode()) {
diff --git
a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/metrics/RpcDetailedMetrics.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/metrics/RpcDetailedMetrics.java
index 99a0afd..caa3452 100644
---
a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/metrics/RpcDetailedMetrics.java
+++
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/metrics/RpcDetailedMetrics.java
@@ -70,16 +70,12 @@ public class RpcDetailedMetrics {
* @param processingTime the processing time
*/
//@Override // some instrumentation interface
- public void addProcessingTime(String metName, long processingTime) {
- rates.add(metName, processingTime);
+ public void addProcessingTime(String name, int processingTime) {
+ rates.add(name, processingTime);
}
- public void addDeferredProcessingTime(String metName, long processingTime) {
- deferredRpcRates.add(metName, processingTime);
- }
-
- public MutableRatesWithAggregation getMutableRates() {
- return rates;
+ public void addDeferredProcessingTime(String name, long processingTime) {
+ deferredRpcRates.add(name, processingTime);
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]