Revert "HDFS-14084. Need for more stats in DFSClient. Contributed by Pranay Singh."
This reverts commit 1f39eae7e6
.
This commit is contained in:
parent
5dce9d75e6
commit
6236de9e23
|
@ -34,7 +34,6 @@ import org.apache.hadoop.io.WritableUtils;
|
||||||
import org.apache.hadoop.io.retry.RetryPolicies;
|
import org.apache.hadoop.io.retry.RetryPolicies;
|
||||||
import org.apache.hadoop.io.retry.RetryPolicy;
|
import org.apache.hadoop.io.retry.RetryPolicy;
|
||||||
import org.apache.hadoop.io.retry.RetryPolicy.RetryAction;
|
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.RPC.RpcKind;
|
||||||
import org.apache.hadoop.ipc.Server.AuthProtocol;
|
import org.apache.hadoop.ipc.Server.AuthProtocol;
|
||||||
import org.apache.hadoop.ipc.protobuf.IpcConnectionContextProtos.IpcConnectionContextProto;
|
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 class Client implements AutoCloseable {
|
||||||
|
|
||||||
public static final Logger LOG = LoggerFactory.getLogger(Client.class);
|
public static final Logger LOG = LoggerFactory.getLogger(Client.class);
|
||||||
private final RpcDetailedMetrics rpcDetailedMetrics;
|
|
||||||
|
|
||||||
/** A counter for generating call IDs. */
|
/** A counter for generating call IDs. */
|
||||||
private static final AtomicInteger callIdCounter = new AtomicInteger();
|
private static final AtomicInteger callIdCounter = new AtomicInteger();
|
||||||
|
@ -210,24 +208,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
|
* set the ping interval value in configuration
|
||||||
*
|
*
|
||||||
|
@ -1321,11 +1301,6 @@ public class Client implements AutoCloseable {
|
||||||
this.maxAsyncCalls = conf.getInt(
|
this.maxAsyncCalls = conf.getInt(
|
||||||
CommonConfigurationKeys.IPC_CLIENT_ASYNC_CALLS_MAX_KEY,
|
CommonConfigurationKeys.IPC_CLIENT_ASYNC_CALLS_MAX_KEY,
|
||||||
CommonConfigurationKeys.IPC_CLIENT_ASYNC_CALLS_MAX_DEFAULT);
|
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -49,8 +49,6 @@ import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
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.
|
* RPC Engine for for protobuf based RPCs.
|
||||||
|
@ -192,7 +190,7 @@ public class ProtobufRpcEngine implements RpcEngine {
|
||||||
throws ServiceException {
|
throws ServiceException {
|
||||||
long startTime = 0;
|
long startTime = 0;
|
||||||
if (LOG.isDebugEnabled()) {
|
if (LOG.isDebugEnabled()) {
|
||||||
startTime = System.currentTimeMillis();
|
startTime = Time.now();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.length != 2) { // RpcController + Message
|
if (args.length != 2) { // RpcController + Message
|
||||||
|
@ -247,16 +245,8 @@ public class ProtobufRpcEngine implements RpcEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LOG.isDebugEnabled()) {
|
if (LOG.isDebugEnabled()) {
|
||||||
long callTime = System.currentTimeMillis() - startTime;
|
long callTime = Time.now() - startTime;
|
||||||
if (callTime > 0) {
|
LOG.debug("Call: " + method.getName() + " took " + callTime + "ms");
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Client.isAsynchronousMode()) {
|
if (Client.isAsynchronousMode()) {
|
||||||
|
|
|
@ -70,16 +70,12 @@ public class RpcDetailedMetrics {
|
||||||
* @param processingTime the processing time
|
* @param processingTime the processing time
|
||||||
*/
|
*/
|
||||||
//@Override // some instrumentation interface
|
//@Override // some instrumentation interface
|
||||||
public void addProcessingTime(String metName, long processingTime) {
|
public void addProcessingTime(String name, int processingTime) {
|
||||||
rates.add(metName, processingTime);
|
rates.add(name, processingTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addDeferredProcessingTime(String metName, long processingTime) {
|
public void addDeferredProcessingTime(String name, long processingTime) {
|
||||||
deferredRpcRates.add(metName, processingTime);
|
deferredRpcRates.add(name, processingTime);
|
||||||
}
|
|
||||||
|
|
||||||
public MutableRatesWithAggregation getMutableRates() {
|
|
||||||
return rates;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue