Search in sources :

Example 1 with IOBalancer

use of com.hazelcast.internal.networking.nio.iobalancer.IOBalancer in project hazelcast by hazelcast.

the class NioNetworking method startIOBalancer.

private void startIOBalancer() {
    ioBalancer = new IOBalancer(inputThreads, outputThreads, threadNamePrefix, balancerIntervalSeconds, loggingService);
    ioBalancer.start();
}
Also used : IOBalancer(com.hazelcast.internal.networking.nio.iobalancer.IOBalancer)

Example 2 with IOBalancer

use of com.hazelcast.internal.networking.nio.iobalancer.IOBalancer in project hazelcast by hazelcast.

the class NioNetworking method provideDynamicMetrics.

@Override
public void provideDynamicMetrics(MetricDescriptor descriptor, MetricsCollectionContext context) {
    for (Channel channel : channels) {
        String pipelineId = channel.localSocketAddress() + "->" + channel.remoteSocketAddress();
        MetricDescriptor descriptorIn = descriptor.copy().withPrefix(TCP_PREFIX_CONNECTION_IN).withDiscriminator(TCP_DISCRIMINATOR_PIPELINEID, pipelineId);
        context.collect(descriptorIn, channel.inboundPipeline());
        MetricDescriptor descriptorOut = descriptor.copy().withPrefix(TCP_PREFIX_CONNECTION_OUT).withDiscriminator(TCP_DISCRIMINATOR_PIPELINEID, pipelineId);
        context.collect(descriptorOut, channel.outboundPipeline());
    }
    NioThread[] inputThreads = this.inputThreads;
    if (inputThreads != null) {
        for (NioThread nioThread : inputThreads) {
            MetricDescriptor descriptorInThread = descriptor.copy().withPrefix(TCP_PREFIX_INPUTTHREAD).withDiscriminator(TCP_DISCRIMINATOR_THREAD, nioThread.getName());
            context.collect(descriptorInThread, nioThread);
        }
    }
    NioThread[] outputThreads = this.outputThreads;
    if (outputThreads != null) {
        for (NioThread nioThread : outputThreads) {
            MetricDescriptor descriptorOutThread = descriptor.copy().withPrefix(TCP_PREFIX_OUTPUTTHREAD).withDiscriminator(TCP_DISCRIMINATOR_THREAD, nioThread.getName());
            context.collect(descriptorOutThread, nioThread);
        }
    }
    IOBalancer ioBalancer = this.ioBalancer;
    if (ioBalancer != null) {
        MetricDescriptor descriptorBalancer = descriptor.copy().withPrefix(TCP_PREFIX_BALANCER);
        context.collect(descriptorBalancer, ioBalancer);
    }
    MetricDescriptor descriptorTcp = descriptor.copy().withPrefix(TCP_PREFIX);
    context.collect(descriptorTcp, this);
}
Also used : MetricDescriptor(com.hazelcast.internal.metrics.MetricDescriptor) IOBalancer(com.hazelcast.internal.networking.nio.iobalancer.IOBalancer) SocketChannel(java.nio.channels.SocketChannel) Channel(com.hazelcast.internal.networking.Channel)

Aggregations

IOBalancer (com.hazelcast.internal.networking.nio.iobalancer.IOBalancer)2 MetricDescriptor (com.hazelcast.internal.metrics.MetricDescriptor)1 Channel (com.hazelcast.internal.networking.Channel)1 SocketChannel (java.nio.channels.SocketChannel)1