本文整理汇总了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)));
}