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;
}
Aggregations