MetricsHelper { public static void config(VertxOptions vertxOptions, String influxUrl, String influxDbName, String influxUserName, String influxPassword) { VertxInfluxDbOptions influxDbOptions = new VertxInfluxDbOptions() .setEnabled(true) .setUri(influxUrl == null ? "http: .setDb(influxDbName == null ? "okapi" : influxDbName); if (influxUserName != null) { influxDbOptions.setUserName(influxUserName); } logger.info("Influx config: {}", () -> influxDbOptions.toJson().encodePrettily()); if (influxPassword != null) { influxDbOptions.setPassword(influxPassword); } vertxOptions.setMetricsOptions(new MicrometerMetricsOptions() .setEnabled(true) .setInfluxDbOptions(influxDbOptions)); enabled = true; } private  MetricsHelper(); static void config(VertxOptions vertxOptions, String influxUrl,
      String influxDbName, String influxUserName, String influxPassword); static Sample getTimerSample(); static Timer recordHttpServerProcessingTime(Sample sample, String tenant,
      int httpStatusCode, String httpMethod, ModuleInstance moduleInstance); static Timer recordHttpClientResponse(Sample sample, String tenant, int httpStatusCode,
      String httpMethod, ModuleInstance moduleInstance); static Counter recordHttpClientError(String tenant, String httpMethod, String urlPath); static boolean isEnabled(); static void setEnabled(boolean enabled);  }
@Test void testConfig() { VertxOptions vopt = new VertxOptions(); MetricsHelper.config(vopt, null, null, null, null); verifyConfig(vopt, "http: MetricsHelper.config(vopt, "a", "b", "c", "d"); verifyConfig(vopt, "a", "b", "c", "d"); }