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();
}
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);
}
Aggregations