本文整理汇总了Java中enkan.component.metrics.MetricsComponent类的典型用法代码示例。如果您正苦于以下问题:Java MetricsComponent类的具体用法?Java MetricsComponent怎么用?Java MetricsComponent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MetricsComponent类属于enkan.component.metrics包,在下文中一共展示了MetricsComponent类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import enkan.component.metrics.MetricsComponent; //导入依赖的package包/类
@Override
public EnkanSystem create() {
return EnkanSystem.of(
"doma", new DomaProvider(),
"jackson", new JacksonBeansConverter(),
"flyway", new FlywayMigration(),
"template", new FreemarkerTemplateEngine(),
"metrics", new MetricsComponent(),
"datasource", new HikariCPComponent(OptionMap.of("uri", "jdbc:h2:mem:test")),
"app", new ApplicationComponent("scaffold.crud.MyApplicationFactory"),
"http", builder(new UndertowComponent())
.set(UndertowComponent::setPort, Env.getInt("PORT", 3000))
.build()
).relationships(
component("http").using("app"),
component("app").using("datasource", "template", "doma", "jackson", "metrics"),
component("doma").using("datasource", "flyway"),
component("flyway").using("datasource")
);
}
示例2: create
import enkan.component.metrics.MetricsComponent; //导入依赖的package包/类
@Override
public EnkanSystem create() {
return EnkanSystem.of(
"hmac", new HmacEncoder(),
"doma", builder(new DomaProvider())
.set(DomaProvider::setDialect, new H2Dialect())
.build(),
"jackson", new JacksonBeansConverter(),
"flyway", new FlywayMigration(),
"template", new FreemarkerTemplateEngine(),
"metrics", new MetricsComponent(),
"datasource", new HikariCPComponent(OptionMap.of("uri", "jdbc:h2:mem:test")),
"app", new ApplicationComponent("kotowari.example.ExampleApplicationFactory"),
"http", builder(new UndertowComponent())
.set(WebServerComponent::setPort, Env.getInt("PORT", 3000))
.set(WebServerComponent::setSslPort, Env.getInt("SSL_PORT", 3002))
.set(WebServerComponent::setSsl, Env.getInt("SSL_PORT", 0) != 0)
.set(WebServerComponent::setKeystorePath, Env.get("KEYSTORE_PATH"))
.set(WebServerComponent::setKeystorePassword, Env.get("KEYSTORE_PASSWORD"))
.build()
).relationships(
component("http").using("app"),
component("app").using("datasource", "template", "doma", "jackson", "metrics", "hmac"),
component("doma").using("datasource", "flyway"),
component("flyway").using("datasource")
);
}
示例3: create
import enkan.component.metrics.MetricsComponent; //导入依赖的package包/类
@Override
public EnkanSystem create() {
return EnkanSystem.of(
"hmac", new HmacEncoder(),
"config", builder(new BouncrConfiguration())
.set(BouncrConfiguration::setPasswordPolicy, builder(new PasswordPolicy())
.set(PasswordPolicy::setExpires, Duration.ofDays(10))
.build())
.build(),
"doma", new DomaProvider(),
"jackson", new JacksonBeansConverter(),
"storeprovider", new StoreProvider(),
"flake", new Flake(),
"certificate", new CertificateProvider(),
"trustManager", builder(new ReloadableTrustManager())
.set(ReloadableTrustManager::setTruststorePath, Env.getString("TRUSTSTORE_PATH", ""))
.set(ReloadableTrustManager::setTruststorePassword, Env.getString("TRUSTSTORE_PASSWORD", ""))
.build(),
"jwt", new JsonWebToken(),
"realmCache", new RealmCache(),
"flyway", new FlywayMigration(),
"template", new FreemarkerTemplateEngine(),
"metrics", new MetricsComponent(),
"datasource", new HikariCPComponent(OptionMap.of(
"uri", Env.getString("JDBC_URL", "jdbc:h2:mem:test"),
"username", Env.get("JDBC_USER"),
"password", Env.get("JDBC_PASSWORD"))),
"app", new ApplicationComponent("net.unit8.bouncr.BouncrApplicationFactory"),
"http", builder(new ReverseProxyComponent())
.set(ReverseProxyComponent::setPort, Env.getInt("PORT", 3000))
.set(ReverseProxyComponent::setSslPort, Env.getInt("SSL_PORT", 3002))
.set(ReverseProxyComponent::setSsl, Env.get("SSL_PORT") != null)
.set(ReverseProxyComponent::setKeystorePath, Env.getString("KEYSTORE_PATH", ""))
.set(ReverseProxyComponent::setKeystorePassword, Env.getString("KEYSTORE_PASSWORD", ""))
.build()
).relationships(
component("http").using("app", "storeprovider", "realmCache", "trustManager", "config", "jwt"),
component("app").using(
"storeprovider", "datasource", "template", "doma", "jackson", "metrics",
"realmCache", "config", "jwt", "certificate", "trustManager"),
component("storeprovider").using("config"),
component("realmCache").using("doma"),
component("doma").using("datasource", "flyway"),
component("flyway").using("datasource"),
component("certificate").using("flake", "config"),
component("jwt").using("config")
);
}
示例4: findMetrics
import enkan.component.metrics.MetricsComponent; //导入依赖的package包/类
protected Optional<MetricsComponent> findMetrics(EnkanSystem system) {
return system.getAllComponents().stream()
.filter(c -> c instanceof MetricsComponent)
.map(MetricsComponent.class::cast)
.findFirst();
}