use of com.alibaba.jstorm.common.metric.AsmHistogram in project jstorm by alibaba.
the class MessageDecoder method getTransmitHistogram.
public AsmHistogram getTransmitHistogram(Channel channel, int clientPort) {
AsmHistogram netTransTime = networkTransmitTimeMap.get(channel);
if (netTransTime == null) {
InetSocketAddress sockAddr = (InetSocketAddress) (channel.getRemoteAddress());
String nettyConnection = NettyConnection.mkString(sockAddr.getAddress().getHostAddress(), clientPort, localIp, localPort);
netTransTime = (AsmHistogram) JStormMetrics.registerNettyMetric(MetricUtils.nettyMetricName(AsmMetric.mkName(MetricDef.NETTY_SRV_MSG_TRANS_TIME, nettyConnection), MetricType.HISTOGRAM), new AsmHistogram());
networkTransmitTimeMap.put(channel, netTransTime);
transmitNameMap.put(channel, nettyConnection);
LOG.info("Register Transmit Histogram of {}, channel {}", nettyConnection, channel);
}
return netTransTime;
}
Aggregations