public class RpcActivityMBean extends MetricsDynamicMBeanBase
For the metrics that are sampled and averaged, one must specify a metrics context that does periodic update calls. Most metrics contexts do. The default Null metrics context however does NOT. So if you aren't using any other metrics context then you can turn on the viewing and averaging of sampled metrics by specifying the following two lines in the hadoop-meterics.properties file:
rpc.class=org.apache.hadoop.metrics.spi.NullContextWithUpdateThread rpc.period=10
Note that the metrics are collected regardless of the context used. The context with the update thread is used to average the data periodically Impl details: We use a dynamic mbean that gets the list of the metrics from the metrics registry passed as an argument to the constructor
Constructor and Description |
---|
RpcActivityMBean(MetricsRegistry mr,
String serviceName,
String port) |
Modifier and Type | Method and Description |
---|---|
void |
shutdown() |
getAttribute, getAttributes, getMBeanInfo, invoke, setAttribute, setAttributes
public RpcActivityMBean(MetricsRegistry mr, String serviceName, String port)
mr
- - the metrics registry that has all the metricsserviceName
- - the service name for the rpc serviceport
- - the rpc port.Copyright © 2010 The Apache Software Foundation