VertxOptions.setMetricsOptions
Code IndexAdd Codota to your IDE (free)

Best code snippets using io.vertx.core.VertxOptions.setMetricsOptions(Showing top 15 results out of 315)

  • Common ways to obtain VertxOptions
private void myMethod () {
VertxOptions v =
  • new VertxOptions()
  • Smart code suggestions by Codota
}
origin: eclipse/vert.x

@Override
protected VertxOptions getOptions() {
 VertxOptions options = super.getOptions();
 options.setMetricsOptions(new MetricsOptions().setEnabled(true).setFactory(new FakeMetricsFactory()));
 return options;
}
origin: eclipse/vert.x

@Test
public void testSetMetricsInstance() {
 DummyVertxMetrics metrics = DummyVertxMetrics.INSTANCE;
 vertx.close();
 vertx = Vertx.vertx(new VertxOptions().setMetricsOptions(new MetricsOptions().setEnabled(true).setFactory(new SimpleVertxMetricsFactory<>(metrics))));
 assertSame(metrics, ((VertxInternal) vertx).metricsSPI());
}
origin: eclipse/vert.x

@Test
public void testFactory() throws Exception {
 AtomicReference<Thread> metricsThread = new AtomicReference<>();
 AtomicReference<Context> metricsContext = new AtomicReference<>();
 VertxMetricsFactory factory = (vertx, options) -> {
  metricsThread.set(Thread.currentThread());
  metricsContext.set(Vertx.currentContext());
  return DummyVertxMetrics.INSTANCE;
 };
 vertx(new VertxOptions().setMetricsOptions(new MetricsOptions().setEnabled(true).setFactory(factory)));
 assertSame(Thread.currentThread(), metricsThread.get());
 assertNull(metricsContext.get());
}
origin: eclipse/vert.x

@Test
public void testFactoryInCluster() throws Exception {
 AtomicReference<Thread> metricsThread = new AtomicReference<>();
 AtomicReference<Context> metricsContext = new AtomicReference<>();
 Thread testThread = Thread.currentThread();
 VertxMetricsFactory factory = (vertx, options) -> {
  metricsThread.set(Thread.currentThread());
  metricsContext.set(Vertx.currentContext());
  return DummyVertxMetrics.INSTANCE;
 };
 clusteredVertx(new VertxOptions().setClustered(true).setMetricsOptions(new MetricsOptions().setEnabled(true).setFactory(factory)), onSuccess(vertx -> {
  assertSame(testThread, metricsThread.get());
  assertNull(metricsContext.get());
  testComplete();
 }));
 await();
}
origin: eclipse/vert.x

@Override
protected VertxOptions getOptions() {
 return new VertxOptions().setMetricsOptions(new MetricsOptions().setEnabled(false)); // Just to be explicit
}
origin: eclipse/vert.x

@Test
public void testEventBusLifecycle() {
 AtomicBoolean closeCalled = new AtomicBoolean();
 VertxMetricsFactory factory = (vertx, options) -> new DummyVertxMetrics() {
  @Override
  public EventBusMetrics createMetrics(EventBus eventBus) {
   return new DummyEventBusMetrics() {
    @Override
    public boolean isEnabled() {
     return true;
    }
    @Override
    public void close() {
     closeCalled.set(true);
    }
   };
  }
 };
 Vertx vertx = vertx(new VertxOptions().setMetricsOptions(new MetricsOptions().setEnabled(true).setFactory(factory)));
 vertx.eventBus();
 executeInVanillaThread(() -> {
  vertx.close(onSuccess(v -> {
   assertTrue(closeCalled.get());
   testComplete();
  }));
 });
 await();
}
origin: eclipse/vert.x

@Test
public void testThreadPoolMetricsWithNamedExecuteBlocking() {
 vertx = Vertx.vertx(new VertxOptions().setMetricsOptions(new MetricsOptions().setEnabled(true).setFactory(new FakeMetricsFactory())));
origin: eclipse/vert.x

Vertx vertx = vertx(new VertxOptions().setMetricsOptions(new MetricsOptions().setEnabled(true).setFactory(factory)));
vertx.deployVerticle(new AbstractVerticle() {
 @Override
origin: eclipse/vert.x

Vertx vertx = vertx(new VertxOptions().setMetricsOptions(new MetricsOptions().setEnabled(true).setFactory(factory)));
EventBus eb = vertx.eventBus();
runOnContext.accept(vertx, v -> {
origin: eclipse/vert.x

@Test
public void testMetricsFromServiceLoader() {
 vertx.close();
 VertxOptions options = new VertxOptions().setMetricsOptions(new MetricsOptions().setEnabled(true));
 vertx = createVertxLoadingMetricsFromMetaInf(options, "io.vertx.test.fakemetrics.FakeMetricsFactory");
 VertxMetrics metrics = ((VertxInternal) vertx).metricsSPI();
 assertNotNull(metrics);
 assertTrue(metrics instanceof FakeVertxMetrics);
}
origin: eclipse/vert.x

options.setQuorumSize(quorumSize);
options.setHAGroup(haGroup);
options.setMetricsOptions(
  new MetricsOptions().
    setEnabled(metricsEnabled));
origin: eclipse/vert.x

Vertx vertx = vertx(new VertxOptions().setMetricsOptions(new MetricsOptions().setEnabled(true).setFactory(factory)));
Context ctx = contextFactory.apply(vertx);
ctx.runOnContext(v1 -> {
origin: eclipse/vert.x

@Test
public void testMetricsEnabledWithoutConfig() {
 vertx.close();
 vertx = Vertx.vertx(new VertxOptions().setMetricsOptions(new MetricsOptions().setEnabled(true)));
 VertxMetrics metrics = ((VertxInternal) vertx).metricsSPI();
 assertNull(metrics);
}
origin: eclipse/vert.x

@Test
public void testSetMetricsInstanceTakesPrecedenceOverServiceLoader() {
 DummyVertxMetrics metrics = DummyVertxMetrics.INSTANCE;
 vertx.close();
 VertxOptions options = new VertxOptions().setMetricsOptions(new MetricsOptions().setEnabled(true).setFactory(new SimpleVertxMetricsFactory<>(metrics)));
 vertx = createVertxLoadingMetricsFromMetaInf(options, "io.vertx.test.fakemetrics.FakeMetricsFactory");
 assertSame(metrics, ((VertxInternal) vertx).metricsSPI());
}
origin: eclipse/vert.x

@Override
protected VertxOptions getOptions() {
 VertxOptions options = super.getOptions();
 options.setMetricsOptions(new MetricsOptions().setEnabled(true).setFactory(new FakeMetricsFactory()));
 return options;
}
io.vertx.coreVertxOptionssetMetricsOptions

Javadoc

Set the metrics options

Popular methods of VertxOptions

  • <init>
    Create an instance from a io.vertx.core.json.JsonObject
  • setClusterHost
    Set the hostname to be used for clustering.
  • setClustered
    Set whether or not the Vert.x instance will be clustered.
  • setAddressResolverOptions
    Sets the address resolver configuration to configure resolving DNS servers, cache TTL, etc...
  • isClustered
    Is the Vert.x instance clustered?
  • setBlockedThreadCheckInterval
    Sets the value of blocked thread check period, in ms.
  • setClusterManager
    Programmatically set the cluster manager to be used when clustering. Only valid if clustered = true.
  • setEventLoopPoolSize
    Set the number of event loop threads to be used by the Vert.x instance.
  • getClusterHost
    Get the host name to be used for clustering.
  • getClusterPort
    Get the port to be used for clustering
  • getEventLoopPoolSize
    Get the number of event loop threads to be used by the Vert.x instance.
  • getMetricsOptions
  • getEventLoopPoolSize,
  • getMetricsOptions,
  • setClusterPort,
  • setInternalBlockingPoolSize,
  • setMaxEventLoopExecuteTime,
  • setWorkerPoolSize,
  • getAddressResolverOptions,
  • getBlockedThreadCheckInterval,
  • getClusterManager

Popular classes and methods

  • getExternalFilesDir (Context)
  • onCreateOptionsMenu (Activity)
  • getApplicationContext (Context)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • DateFormat (java.text)
    DateFormat is an abstract class for date/time formatting subclasses which formats and parses dates
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)