use of ratpack.dropwizard.metrics.internal.MetricsBroadcaster in project ratpack by ratpack.
the class MetricsWebsocketBroadcastHandler method handle.
@Override
public void handle(final Context context) throws Exception {
final MetricsBroadcaster broadcaster = context.get(MetricsBroadcaster.class);
final ByteBufAllocator byteBufAllocator = context.get(ByteBufAllocator.class);
final DropwizardMetricsConfig config = context.get(DropwizardMetricsConfig.class);
MetricFilter filter = MetricFilter.ALL;
if (config.getWebSocket().isPresent()) {
filter = new RegexMetricFilter(config.getWebSocket().get().getIncludeFilter(), config.getWebSocket().get().getExcludeFilter());
}
websocketByteBufBroadcast(context, broadcaster.map(new MetricRegistryJsonMapper(byteBufAllocator, filter)));
}
Aggregations