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


Java ThreadDeadlockHealthCheck类代码示例

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


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

示例1: init

import com.codahale.metrics.health.jvm.ThreadDeadlockHealthCheck; //导入依赖的package包/类
@PostConstruct
public void init() {
    /*
     * consoleReporter = ConsoleReporter.forRegistry(metricRegistry) .convertRatesTo(TimeUnit.SECONDS)
     * .convertDurationsTo(TimeUnit.MILLISECONDS) .build(); consoleReporter.start(1, TimeUnit.SECONDS);
     */
    GarbageCollectorMetricSet gc = new GarbageCollectorMetricSet();

    // FileDescriptorRatioGauge fd = new FileDescriptorRatioGauge();
    MemoryUsageGaugeSet mu = new MemoryUsageGaugeSet();

    // ThreadDeadlockDetector td = new ThreadDeadlockDetector();

    // ThreadDump t = new ThreadDump();
    ThreadStatesGaugeSet ts = new ThreadStatesGaugeSet();

    metricRegistry.register("GarbageCollector", gc);
    // registry.register(FileDescriptorRatioGauge.class.getName(), fd);
    metricRegistry.register("MemoryUsage", mu);
    // registry.register(ThreadDeadlockDetector.class.getName(), td);
    // registry.registerAll(t);
    metricRegistry.register("ThreadStates", ts);
    healthCheckRegistry.register("threadDeadlock",
            new ThreadDeadlockHealthCheck());
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:26,代码来源:MetricsHelper.java

示例2: init

import com.codahale.metrics.health.jvm.ThreadDeadlockHealthCheck; //导入依赖的package包/类
/**
 * Will initialize Moneta given a configuration.  This <b>must</b> be executed before use.
 * @param config XML configuration
 */
protected final void init(XMLConfiguration config) {
			
	initDataSources(config);
	initTopics(config);
	healthChecks.put("Deadlock", new ThreadDeadlockHealthCheck());
	initRun = true;
}
 
开发者ID:Derek-Ashmore,项目名称:moneta,代码行数:12,代码来源:MonetaConfiguration.java

示例3: registerHealthChecks

import com.codahale.metrics.health.jvm.ThreadDeadlockHealthCheck; //导入依赖的package包/类
private void registerHealthChecks( Application application, HealthCheckRegistry healthChecks )
{
    Config config = application.config().atKey( "metrics" );

    // JVM HealthChecks
    if( config.bool( "healthchecks.deadlocks.enabled" ) )
    {
        healthChecks.register( "jvm.deadlocks", new ThreadDeadlockHealthCheck() );
    }
}
 
开发者ID:werval,项目名称:werval,代码行数:11,代码来源:MetricsPlugin.java

示例4: RegisterJVMMetrics

import com.codahale.metrics.health.jvm.ThreadDeadlockHealthCheck; //导入依赖的package包/类
public RegisterJVMMetrics(CommandBuilder builder, Config config, Command parent, 
                                   Command child, final MorphlineContext context) {
  
  super(builder, config, parent, child, context);      
  validateArguments();
  
  MetricRegistry registry = context.getMetricRegistry();
  BufferPoolMetricSet bufferPoolMetrics = new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer());
  registerAll("jvm.buffers", bufferPoolMetrics, registry);
  registerAll("jvm.gc", new GarbageCollectorMetricSet(), registry);
  registerAll("jvm.memory", new MemoryUsageGaugeSet(), registry);
  registerAll("jvm.threads", new ThreadStatesGaugeSet(), registry);
  register("jvm.fileDescriptorCountRatio", new FileDescriptorRatioGauge(), registry);
  context.getHealthCheckRegistry().register("deadlocks", new ThreadDeadlockHealthCheck());
}
 
开发者ID:cloudera,项目名称:cdk,代码行数:16,代码来源:RegisterJVMMetricsBuilder.java

示例5: init

import com.codahale.metrics.health.jvm.ThreadDeadlockHealthCheck; //导入依赖的package包/类
/**
 * Initializer method for the metrics registry. Call this method before registering
 * new metrics with the registry.
 */
public static void init() {
  // Metrics registries will be initialized only if enabled
  if(!Configuration.root().getBoolean("metrics", false)) {
    LOGGER.debug("Metrics not enabled in the conf file.");
    return;
  }

  // Metrics & healthcheck registries will be initialized only once
  if(_metricRegistry != null) {
    LOGGER.debug("Metric registries already initialized.");
    return;
  }

  _metricRegistry = new MetricRegistry();

  String className = AnalyticJob.class.getSimpleName();

  _skippedJobs = _metricRegistry.meter(name(className, "skippedJobs", "count"));
  _processedJobs = _metricRegistry.meter(name(className, "processedJobs", "count"));
  _jobProcessingTime = _metricRegistry.histogram(name(className, "jobProcessingTime", "ms"));
  _metricRegistry.register(name(className, "jobQueue", "size"), new Gauge<Integer>() {
    @Override
    public Integer getValue() {
      return _queueSize;
    }
  });
  _metricRegistry.register(name(className, "lastDayJobs", "count"), new Gauge<Integer>() {
    private static final long DAY = 24 * 60 * 60 * 1000;
    private static final long UPDATE_DELAY = 60 * 1000;

    private long _lastUpdate = 0;
    private int _count = -1;

    @Override
    public Integer getValue() {
      long now = System.currentTimeMillis();
      if (now - _lastUpdate > UPDATE_DELAY) {
        _count = AppResult.find.where()
                .gt(AppResult.TABLE.FINISH_TIME, now - DAY)
                .findRowCount();
        _lastUpdate = now;
      }
      return _count;
    }
  });
  _metricRegistry.register(name(className, "retryQueue", "size"), new Gauge<Integer>() {
    @Override
    public Integer getValue() {
      return _retryQueueSize;
    }
  });
  _metricRegistry.registerAll(new CustomGarbageCollectorMetricSet());
  _metricRegistry.registerAll(new MemoryUsageGaugeSet());

  JmxReporter.forRegistry(_metricRegistry).build().start();

  _healthCheckRegistry = new HealthCheckRegistry();

  _healthCheckRegistry.register("ThreadDeadlockHealthCheck",
      new ThreadDeadlockHealthCheck());
}
 
开发者ID:linkedin,项目名称:dr-elephant,代码行数:66,代码来源:MetricsController.java

示例6: setHealthCheckRegistry

import com.codahale.metrics.health.jvm.ThreadDeadlockHealthCheck; //导入依赖的package包/类
@Autowired
public void setHealthCheckRegistry(HealthCheckRegistry registry) {
    registry.register(ThreadDeadlockHealthCheck.class.getName(), new ThreadDeadlockHealthCheck());
}
 
开发者ID:codeabovelab,项目名称:haven-platform,代码行数:5,代码来源:HealthCheckConfiguration.java

示例7: get

import com.codahale.metrics.health.jvm.ThreadDeadlockHealthCheck; //导入依赖的package包/类
public HealthCheck get() {
  return new ThreadDeadlockHealthCheck();
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:4,代码来源:DeadlockHealthCheckProvider.java

示例8: init

import com.codahale.metrics.health.jvm.ThreadDeadlockHealthCheck; //导入依赖的package包/类
@PostConstruct
public void init() {
    ThreadDeadlockHealthCheck threadDeadlockHealthCheck = new ThreadDeadlockHealthCheck();
    healthCheckRegistry.register("threadDeadlockHealthCheck", threadDeadlockHealthCheck);
}
 
开发者ID:motech,项目名称:modules,代码行数:6,代码来源:HealthCheckRegistryInitializer.java

示例9: configureHealthChecks

import com.codahale.metrics.health.jvm.ThreadDeadlockHealthCheck; //导入依赖的package包/类
protected void configureHealthChecks() {
    HealthCheckRegistry healthCheckRegistry = getHealthCheckRegistry();
    healthCheckRegistry.register("threadDeadlock", new ThreadDeadlockHealthCheck());
}
 
开发者ID:wotifgroup,项目名称:grails-lightweight-deploy,代码行数:5,代码来源:Launcher.java


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