Before netty 1.0.0, we used tcpServer::bootstrap to register a gauge for pending task queue of the eventloop
factory.addServerCustomizers(httpServer -> httpServer.tcpConfiguration(
tcpServer -> tcpServer.bootstrap(serverBootstrap -> {
serverBootstrap.config().childGroup().forEach(eventExecutor -> {
if (SingleThreadEventExecutor.class.isAssignableFrom(eventExecutor.getClass())) {
SingleThreadEventExecutor singleThreadEventExecutor = (SingleThreadEventExecutor) eventExecutor;
Gauge.builder(SERVER_PENDING_TASK_METRIC, singleThreadEventExecutor::pendingTasks)
.description("Pending Tasks")
.tag(SERVER_THREAD_NAME, singleThreadEventExecutor.threadProperties().name())
.tag(SERVER_THREAD_STATE, singleThreadEventExecutor.threadProperties().state().name())
.register(registry);
}
});
return serverBootstrap;
}
)));
starting with netty 1.0.0, bootstrap is not available anymore. how can this be done now? thx for help