Search in sources :

Example 6 with AsmHistogram

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;
}
Also used : InetSocketAddress(java.net.InetSocketAddress) AsmHistogram(com.alibaba.jstorm.common.metric.AsmHistogram)

Aggregations

AsmHistogram (com.alibaba.jstorm.common.metric.AsmHistogram)6 AsmMeter (com.alibaba.jstorm.common.metric.AsmMeter)2 ControlMessage (backtype.storm.messaging.ControlMessage)1 TaskMessage (backtype.storm.messaging.TaskMessage)1 AsmGauge (com.alibaba.jstorm.common.metric.AsmGauge)1 AsmMetric (com.alibaba.jstorm.common.metric.AsmMetric)1 QueueGauge (com.alibaba.jstorm.common.metric.QueueGauge)1 JStormHealthCheck (com.alibaba.jstorm.metric.JStormHealthCheck)1 HealthCheck (com.codahale.metrics.health.HealthCheck)1 InetSocketAddress (java.net.InetSocketAddress)1 AtomicLong (java.util.concurrent.atomic.AtomicLong)1 ChannelBuffer (org.jboss.netty.buffer.ChannelBuffer)1