本文整理匯總了Java中io.vertx.core.VertxOptions.setMetricsOptions方法的典型用法代碼示例。如果您正苦於以下問題:Java VertxOptions.setMetricsOptions方法的具體用法?Java VertxOptions.setMetricsOptions怎麽用?Java VertxOptions.setMetricsOptions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類io.vertx.core.VertxOptions
的用法示例。
在下文中一共展示了VertxOptions.setMetricsOptions方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: config
import io.vertx.core.VertxOptions; //導入方法依賴的package包/類
public static void config(String graphiteHost, int port, TimeUnit tu,
int period, VertxOptions vopt, String hostName) {
final String registryName = "okapi";
MetricRegistry registry = SharedMetricRegistries.getOrCreate(registryName);
DropwizardMetricsOptions metricsOpt = new DropwizardMetricsOptions();
metricsOpt.setEnabled(true).setRegistryName(registryName);
vopt.setMetricsOptions(metricsOpt);
Graphite graphite = new Graphite(new InetSocketAddress(graphiteHost, port));
final String prefix = "folio.okapi." + hostName ;
GraphiteReporter reporter = GraphiteReporter.forRegistry(registry)
.prefixedWith(prefix)
.build(graphite);
reporter.start(period, tu);
logger.info("Metrics remote:" + graphiteHost + ":"
+ port + " this:" + prefix);
}
示例2: provideVertx
import io.vertx.core.VertxOptions; //導入方法依賴的package包/類
@Provides
@Singleton
public Vertx provideVertx(ApplicationConfiguration applicationConfiguration) {
VertxOptions vertxOptions =
new VertxOptions()
.setMaxEventLoopExecuteTime(applicationConfiguration.getMaxEventLoopExecutionTime())
.setWarningExceptionTime(20L * 1000 * 1000000)
.setMaxWorkerExecuteTime(applicationConfiguration.getMaxWorkerExecutionTime())
.setWorkerPoolSize(applicationConfiguration.getWorkerPoolSize());
// see
// https://github.com/vert-x3/vertx-dropwizard-metrics/blob/master/src/main/asciidoc/java/index.adoc#jmx
vertxOptions.setMetricsOptions(
new DropwizardMetricsOptions()
.setEnabled(applicationConfiguration.isMetricsEnabled())
.setJmxEnabled(applicationConfiguration.isJmxEnabled())
.setJmxDomain(applicationConfiguration.getJmxDomainName()));
return Vertx.vertx(vertxOptions);
}
示例3: vertx
import io.vertx.core.VertxOptions; //導入方法依賴的package包/類
/**
* Gets the singleton Vert.x instance to be used by Hono.
*
* @return the instance.
*/
@Bean
public Vertx vertx() {
VertxOptions options = new VertxOptions()
.setWarningExceptionTime(1500000000)
.setAddressResolverOptions(new AddressResolverOptions()
.setCacheNegativeTimeToLive(0) // discard failed DNS lookup results immediately
.setCacheMaxTimeToLive(0) // support DNS based service resolution
.setQueryTimeout(1000));
if (metricsOptions != null) {
options.setMetricsOptions(metricsOptions);
}
return Vertx.vertx(options);
}
示例4: vertx
import io.vertx.core.VertxOptions; //導入方法依賴的package包/類
/**
* Exposes a Vert.x instance as a Spring bean.
*
* @return The Vert.x instance.
*/
@Bean
public Vertx vertx() {
VertxOptions options = new VertxOptions()
.setWarningExceptionTime(1500000000)
.setAddressResolverOptions(new AddressResolverOptions()
.setCacheNegativeTimeToLive(0) // discard failed DNS lookup results immediately
.setCacheMaxTimeToLive(0) // support DNS based service resolution
.setQueryTimeout(1000));
if (metricsOptions != null) {
options.setMetricsOptions(metricsOptions);
}
return Vertx.vertx(options);
}
示例5: beforeStartingVertx
import io.vertx.core.VertxOptions; //導入方法依賴的package包/類
@Override
public void beforeStartingVertx(VertxOptions options) {
// TODO Auto-generated method stub
super.beforeStartingVertx(options);
System.out.println("starting rest verticle service..........");
options.setBlockedThreadCheckInterval(1500000);
options.setWarningExceptionTime(1500000);
options.setMetricsOptions(new DropwizardMetricsOptions().setEnabled(true).addMonitoredHttpServerUri(
new Match().setValue("/.*").setType(MatchType.REGEX)));
}