当前位置: 首页>>代码示例>>Java>>正文


Java MetricsComponent类代码示例

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

}
 
开发者ID:kawasima,项目名称:kotowari-crud,代码行数:22,代码来源:MyEnkanSystemFactory.java

示例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")
    );

}
 
开发者ID:kawasima,项目名称:enkan,代码行数:29,代码来源:ExampleSystemFactory.java

示例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")
    );
}
 
开发者ID:kawasima,项目名称:bouncr,代码行数:49,代码来源:BouncrEnkanSystem.java

示例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();
}
 
开发者ID:kawasima,项目名称:enkan,代码行数:7,代码来源:MetricsCommandRegister.java


注:本文中的enkan.component.metrics.MetricsComponent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。