use of org.graylog2.plugin.LocalMetricRegistry in project graylog2-server by Graylog2.
the class StateTest method testMetricName.
@Test
public void testMetricName() {
final PipelineInterpreter.State state = new PipelineInterpreter.State(null, null, null, new LocalMetricRegistry(), 1, false);
assertEquals("org.graylog.plugins.pipelineprocessor.processors.PipelineInterpreter.stage-cache", state.getStageCacheMetricName());
}
use of org.graylog2.plugin.LocalMetricRegistry in project graylog2-server by Graylog2.
the class NetFlowUdpTransportTest method setUp.
@Before
public void setUp() {
final NettyTransportConfiguration nettyTransportConfiguration = new NettyTransportConfiguration("nio", "jdk", 1);
eventLoopGroupFactory = new EventLoopGroupFactory(nettyTransportConfiguration);
eventLoopGroup = new NioEventLoopGroup(1);
transport = new NetFlowUdpTransport(Configuration.EMPTY_CONFIGURATION, eventLoopGroupFactory, nettyTransportConfiguration, new ThroughputCounter(eventLoopGroup), new LocalMetricRegistry());
transport.setMessageAggregator(new NetflowV9CodecAggregator());
}
use of org.graylog2.plugin.LocalMetricRegistry in project graylog2-server by Graylog2.
the class BeatsTransportTest method customChildChannelHandlersContainBeatsHandler.
@Test
public void customChildChannelHandlersContainBeatsHandler() {
final NettyTransportConfiguration nettyTransportConfiguration = new NettyTransportConfiguration("nio", "jdk", 1);
final EventLoopGroupFactory eventLoopGroupFactory = new EventLoopGroupFactory(nettyTransportConfiguration);
final BeatsTransport transport = new BeatsTransport(Configuration.EMPTY_CONFIGURATION, eventLoopGroup, eventLoopGroupFactory, nettyTransportConfiguration, new ThroughputCounter(eventLoopGroup), new LocalMetricRegistry(), tlsConfiguration);
final MessageInput input = mock(MessageInput.class);
assertThat(transport.getCustomChildChannelHandlers(input)).containsKey("beats");
}
use of org.graylog2.plugin.LocalMetricRegistry in project graylog2-server by Graylog2.
the class UdpTransportTest method setUp.
@Before
@SuppressForbidden("Executors#newSingleThreadExecutor() is okay for tests")
public void setUp() throws Exception {
eventLoopGroupFactory = new EventLoopGroupFactory(nettyTransportConfiguration);
localMetricRegistry = new LocalMetricRegistry();
eventLoopGroup = eventLoopGroupFactory.create(1, localMetricRegistry, "test");
throughputCounter = new ThroughputCounter(eventLoopGroup);
udpTransport = new UdpTransport(CONFIGURATION, eventLoopGroupFactory, nettyTransportConfiguration, throughputCounter, localMetricRegistry);
}
use of org.graylog2.plugin.LocalMetricRegistry in project graylog2-server by Graylog2.
the class UdpTransportTest method launchTransportForBootStrapTest.
private UdpTransport launchTransportForBootStrapTest(final ChannelInboundHandler channelHandler) throws MisfireException {
final UdpTransport transport = new UdpTransport(CONFIGURATION, eventLoopGroupFactory, nettyTransportConfiguration, throughputCounter, new LocalMetricRegistry()) {
@Override
protected LinkedHashMap<String, Callable<? extends ChannelHandler>> getChannelHandlers(MessageInput input) {
final LinkedHashMap<String, Callable<? extends ChannelHandler>> handlers = new LinkedHashMap<>();
handlers.put("logging", () -> new LoggingHandler(LogLevel.INFO));
handlers.put("counter", () -> channelHandler);
handlers.putAll(super.getChannelHandlers(input));
return handlers;
}
};
final MessageInput messageInput = mock(MessageInput.class);
when(messageInput.getId()).thenReturn("TEST");
when(messageInput.getName()).thenReturn("TEST");
transport.launch(messageInput);
return transport;
}
Aggregations