• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java HealthCheckModule类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.codahale.metrics.json.HealthCheckModule的典型用法代码示例。如果您正苦于以下问题:Java HealthCheckModule类的具体用法?Java HealthCheckModule怎么用?Java HealthCheckModule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



HealthCheckModule类属于com.codahale.metrics.json包,在下文中一共展示了HealthCheckModule类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: POMObjectMapper

import com.codahale.metrics.json.HealthCheckModule; //导入依赖的package包/类
public POMObjectMapper(JsonFactory fact) {
        super(fact);
        this.registerModule(new TolerantHealthTimeModule());
        this.registerModule(new MetricsModule(TimeUnit.SECONDS, TimeUnit.MILLISECONDS, false));
        this.registerModule(new HealthCheckModule());
//        this.registerModule(new ViewDefDefModule());

        // the following config could be in its own Jackson Module ("VPRModule") if this list gets unwieldy or we want to
        // externalize the VPR's JSON serialization configuration more or not have dependencies on 3rd party libs.  No need right now, though.
        this.setSerializationInclusion(JsonInclude.Include.NON_NULL);
        this.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
        this.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);

        this.addMixInAnnotations(VistaUserDetails.class, VistaUserDetailsJacksonAnnotations.class);
        this.addMixInAnnotations(UserDetails.class, UserDetailsJacksonAnnotations.class);
        this.addMixInAnnotations(GrantedAuthority.class, GrantedAuthorityJacksonAnnotations.class);
    }
 
开发者ID:KRMAssociatesInc,项目名称:eHMP,代码行数:18,代码来源:POMObjectMapper.java


示例2: onActivate

import com.codahale.metrics.json.HealthCheckModule; //导入依赖的package包/类
@Override
public void onActivate( Application application )
    throws ActivationException
{
    application.plugin( JSON.class ).mapper()
        .registerModule( new MetricsModule( SECONDS, MILLISECONDS, true ) )
        .registerModule( new HealthCheckModule() );
    MetricRegistry metrics = new MetricRegistry();
    HealthCheckRegistry healthChecks = new HealthCheckRegistry();

    registerMetrics( application, metrics );
    registerMetricsReporters( application, metrics );
    registerHealthChecks( application, healthChecks );

    api = new Metrics( metrics, healthChecks );
}
 
开发者ID:werval,项目名称:werval,代码行数:17,代码来源:MetricsPlugin.java


示例3: init

import com.codahale.metrics.json.HealthCheckModule; //导入依赖的package包/类
@Override
public void init(ServletConfig servletConfig) throws ServletException {
    super.init(servletConfig);

    boolean disableAuthorization = Boolean.TRUE.toString().equalsIgnoreCase(servletConfig.getInitParameter(DISABLE_AUTHORIZATION_INIT_PARAM));
    if (!disableAuthorization) {
        String credentials = null;

        String username = servletConfig.getInitParameter(USERNAME_INIT_PARAM);
        String password = servletConfig.getInitParameter(PASSWORD_INIT_PARAM);
        if (StringUtils.isNotBlank(username) && StringUtils.isNotBlank(password)) {
            credentials = username.trim() + ":" + password.trim();
        } else {
            credentials = DEFAULT_CREDENTIALS;
        }

        this.encodedCredentials = BaseEncoding.base64().encode(credentials.getBytes());
    }

    this.objectMapper = new ObjectMapper()
            .registerModule(new MetricsModule(TimeUnit.SECONDS, TimeUnit.MICROSECONDS, false))
            .registerModule(new HealthCheckModule())
            .setSerializationInclusion(JsonInclude.Include.NON_NULL)
            .setTimeZone(TimeZone.getDefault())
            .setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z"));

    this.graphiteMetricFormatter = new GraphiteMetricFormatter(TimeUnit.SECONDS, TimeUnit.MICROSECONDS);

    try {
        this.threadDumpGenerator = new ThreadDump(ManagementFactory.getThreadMXBean());
    } catch (NoClassDefFoundError ignore) {
    }

    ServletContext servletContext = servletConfig.getServletContext();
    String servletSpecVersion = servletContext.getMajorVersion() + "." + servletContext.getMinorVersion();
    this.serverInfo = ServerInfo.create(servletContext.getServerInfo(), servletSpecVersion);
}
 
开发者ID:centro,项目名称:monitoring-center,代码行数:38,代码来源:MonitoringCenterServlet.java


示例4: AmqpReporter

import com.codahale.metrics.json.HealthCheckModule; //导入依赖的package包/类
private AmqpReporter(Builder builder) {
    super(builder.registry, "amqp-reporter", builder.filter, builder.rateUnit, builder.durationUnit);
    this.routingKey = builder.routingKey;
    this.exchangeName = builder.exchangeName;
    Assert.hasText(this.exchangeName, "exchangeName is null or empty");
    this.exchangeFactory = builder.exchangeFactory;
    this.messagePropertiesCallback = builder.messagePropertiesCallback;


    this.connectionFactoryProvider = builder.connectionFactoryProvider;
    Assert.notNull(this.connectionFactoryProvider, "connectionFactoryProvider can't be null");

    objectMapper.registerModules(new HealthCheckModule(),
      new MetricsModule(builder.rateUnit, builder.durationUnit, false /* if enable histogram data will be serialized */));
}
 
开发者ID:codeabovelab,项目名称:haven-platform,代码行数:16,代码来源:AmqpReporter.java


示例5: MetricsContent

import com.codahale.metrics.json.HealthCheckModule; //导入依赖的package包/类
public MetricsContent(String name, MetricRegistry metricsRegistry) {
    super(name);
    this.registry = metricsRegistry;
    objectMapper = new ObjectMapper();
    objectMapper.registerModule(new MetricsModule(TimeUnit.MINUTES, TimeUnit.SECONDS, true));
    objectMapper.registerModule(new HealthCheckModule());
    objectMapper.enable(SerializationFeature.INDENT_OUTPUT);
}
 
开发者ID:jenkinsci,项目名称:support-core-plugin,代码行数:9,代码来源:MetricsContent.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PortalTravelAgent类代码示例发布时间:2022-05-22
下一篇:
Java InstanceRegisteredEvent类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap