Class DataNodePeerMetrics
java.lang.Object
org.apache.hadoop.hdfs.server.datanode.metrics.DataNodePeerMetrics
This class maintains DataNode peer metrics (e.g. numOps, AvgTime, etc.) for
various peer operations.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSendPacketDownstream(String peerAddr, long elapsedMs) Adds invocation and elapsed time of SendPacketDownstream for peer.voidCollects states maintained inThreadLocal, if any.static DataNodePeerMetricsCreates an instance of DataNodePeerMetrics, used for registration.Dump SendPacketDownstreamRollingAvgTime metrics as JSON.longlonglongRetrieve the set of dataNodes that look significantly slower than their peers.org.apache.hadoop.metrics2.lib.MutableRollingAveragesname()voidsetLowThresholdMs(long thresholdMs) voidsetMinOutlierDetectionNodes(long minNodes) voidsetMinOutlierDetectionSamples(long minSamples) voidsetTestOutliers(Map<String, org.apache.hadoop.hdfs.server.protocol.OutlierMetrics> outlier) Strictly to be used by test code only.
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG
-
-
Constructor Details
-
DataNodePeerMetrics
-
-
Method Details
-
name
-
getMinOutlierDetectionSamples
public long getMinOutlierDetectionSamples() -
create
Creates an instance of DataNodePeerMetrics, used for registration. -
addSendPacketDownstream
Adds invocation and elapsed time of SendPacketDownstream for peer.The caller should pass in a well-formatted peerAddr. e.g. "[192.168.1.110:1010]" is good. This will be translated into a full qualified metric name, e.g. "[192.168.1.110:1010]AvgTime".
-
dumpSendPacketDownstreamAvgInfoAsJson
Dump SendPacketDownstreamRollingAvgTime metrics as JSON. -
collectThreadLocalStates
public void collectThreadLocalStates()Collects states maintained inThreadLocal, if any. -
getOutliers
Retrieve the set of dataNodes that look significantly slower than their peers. -
setTestOutliers
public void setTestOutliers(Map<String, org.apache.hadoop.hdfs.server.protocol.OutlierMetrics> outlier) Strictly to be used by test code only. Source code is not supposed to use this. This method directly sets outlier mapping so that aggregate latency metrics are not calculated for tests.- Parameters:
outlier- outlier directly set by tests.
-
getSendPacketDownstreamRollingAverages
public org.apache.hadoop.metrics2.lib.MutableRollingAverages getSendPacketDownstreamRollingAverages() -
setMinOutlierDetectionNodes
public void setMinOutlierDetectionNodes(long minNodes) -
getMinOutlierDetectionNodes
public long getMinOutlierDetectionNodes() -
setLowThresholdMs
public void setLowThresholdMs(long thresholdMs) -
getLowThresholdMs
public long getLowThresholdMs() -
setMinOutlierDetectionSamples
public void setMinOutlierDetectionSamples(long minSamples) -
getSlowNodeDetector
-