Skip to content

Commit

Permalink
Update to removal of dummy vertx metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj committed Aug 11, 2024
1 parent 2a2ca71 commit 195540d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import io.vertx.core.json.JsonObject;
import io.vertx.core.metrics.MetricsOptions;
import io.vertx.core.metrics.impl.DummyVertxMetrics;
import io.vertx.core.spi.VertxMetricsFactory;
import io.vertx.core.spi.metrics.VertxMetrics;

Expand All @@ -22,9 +21,12 @@
*/
public class CustomMetricsFactory implements VertxMetricsFactory {

public static final VertxMetrics DUMMY = new VertxMetrics() {
};

@Override
public VertxMetrics metrics(VertxOptions options) {
return DummyVertxMetrics.INSTANCE;
return DUMMY;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import io.vertx.core.VertxOptions;
import io.vertx.core.internal.VertxInternal;
import io.vertx.core.json.JsonObject;
import io.vertx.core.metrics.impl.DummyVertxMetrics;
import io.vertx.core.spi.metrics.VertxMetrics;
import io.vertx.test.fakecluster.FakeClusterManager;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -111,7 +111,7 @@ public void beforeStartingVertx(HookContext context) {

@Override
public VertxBuilder createVertxBuilder(VertxOptions options) {
return super.createVertxBuilder(options).withMetrics(o -> DummyVertxMetrics.INSTANCE);
return super.createVertxBuilder(options).withMetrics(o -> new VertxMetrics() {});
}
};
TestVertxApplication app = new TestVertxApplication(new String[0], hooks);
Expand Down
6 changes: 4 additions & 2 deletions cli/src/test/java/io/vertx/core/CustomMetricsFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import io.vertx.core.json.JsonObject;
import io.vertx.core.metrics.MetricsOptions;
import io.vertx.core.metrics.impl.DummyVertxMetrics;
import io.vertx.core.spi.VertxMetricsFactory;
import io.vertx.core.spi.metrics.VertxMetrics;

Expand All @@ -22,9 +21,12 @@
*/
public class CustomMetricsFactory implements VertxMetricsFactory {

public static final VertxMetrics DUMMY = new VertxMetrics() {
};

@Override
public VertxMetrics metrics(VertxOptions options) {
return DummyVertxMetrics.INSTANCE;
return DUMMY;
}

@Override
Expand Down

0 comments on commit 195540d

Please sign in to comment.