Search in sources :

Example 1 with EventBusMetrics

use of io.vertx.core.spi.metrics.EventBusMetrics in project vert.x by eclipse.

the class EventBusRegistrationRaceTest method getOptions.

@Override
protected VertxOptions getOptions() {
    VertxOptions options = super.getOptions();
    options.setMetricsOptions(new MetricsOptions().setEnabled(true).setFactory(new VertxMetricsFactory() {

        @Override
        public VertxMetrics metrics(VertxOptions options) {
            return new VertxMetrics() {

                @Override
                public EventBusMetrics<Void> createEventBusMetrics() {
                    return new EventBusMetrics<Void>() {

                        @Override
                        public void scheduleMessage(Void handler, boolean local) {
                            count.incrementAndGet();
                        }

                        @Override
                        public void messageDelivered(Void handler, boolean local) {
                            count.decrementAndGet();
                        }

                        @Override
                        public void discardMessage(Void handler, boolean local, Message<?> msg) {
                            count.decrementAndGet();
                        }
                    };
                }
            };
        }
    }));
    return options;
}
Also used : MetricsOptions(io.vertx.core.metrics.MetricsOptions) VertxMetrics(io.vertx.core.spi.metrics.VertxMetrics) EventBusMetrics(io.vertx.core.spi.metrics.EventBusMetrics) VertxOptions(io.vertx.core.VertxOptions) VertxMetricsFactory(io.vertx.core.spi.VertxMetricsFactory)

Aggregations

VertxOptions (io.vertx.core.VertxOptions)1 MetricsOptions (io.vertx.core.metrics.MetricsOptions)1 VertxMetricsFactory (io.vertx.core.spi.VertxMetricsFactory)1 EventBusMetrics (io.vertx.core.spi.metrics.EventBusMetrics)1 VertxMetrics (io.vertx.core.spi.metrics.VertxMetrics)1