public class HystrixMetricsEventStreamHandler implements Handler {
@Override
public void handle(Context context) throws Exception {
final HystrixCommandMetricsBroadcaster commandMetricsBroadcasterbroadcaster = context.get(HystrixCommandMetricsBroadcaster.class);
final HystrixCommandMetricsJsonMapper commandMetricsMapper = context.get(HystrixCommandMetricsJsonMapper.class);
final HystrixThreadPoolMetricsBroadcaster threadPoolMetricsBroadcaster = context.get(HystrixThreadPoolMetricsBroadcaster.class);
final HystrixThreadPoolMetricsJsonMapper threadPoolMetricsMapper = context.get(HystrixThreadPoolMetricsJsonMapper.class);
Publisher<String> commandStream = map(fanOut(commandMetricsBroadcasterbroadcaster), commandMetricsMapper);
Publisher<String> threadPoolStream = map(fanOut(threadPoolMetricsBroadcaster), threadPoolMetricsMapper);