Java 类com.codahale.metrics.health.SharedHealthCheckRegistries 实例源码

项目:werval    文件:MetricsPlugin.java   
@Override
public void onPassivate( Application application )
{
    requestTimers.values().forEach( t -> t.stop() );
    requestTimers = null;
    reporters.forEach(
        r ->
        {
            if( r instanceof ScheduledReporter )
            {
                ( (ScheduledReporter) r ).stop();
            }
            else if( r instanceof JmxReporter )
            {
                ( (JmxReporter) r ).stop();
            }
        }
    );
    reporters = null;
    api = null;
    eventRegistration.unregister();
    eventRegistration = null;
    SharedMetricRegistries.clear();
    SharedHealthCheckRegistries.clear();
}
项目:runrightfast-vertx    文件:HealthChecksServiceImpl.java   
@Override
public Set<String> getHealthCheckNames(final String registryName) {
    checkArgument(isNotBlank(registryName));
    if (!SharedHealthCheckRegistries.names().contains(registryName)) {
        return Collections.emptySet();
    }
    return SharedHealthCheckRegistries.getOrCreate(registryName).getNames();
}
项目:runrightfast-vertx    文件:HealthChecksServiceImpl.java   
@Override
public HealthCheck.Result runHealthCheck(final String registryName, final String healthCheckName) {
    checkArgument(isNotBlank(registryName));
    checkArgument(isNotBlank(healthCheckName));
    checkArgument(SharedHealthCheckRegistries.names().contains(registryName));

    final HealthCheckRegistry registry = SharedHealthCheckRegistries.getOrCreate(registryName);
    checkArgument(registry.getNames().contains(healthCheckName));
    final HealthCheck.Result result = registry.runHealthCheck(healthCheckName);
    logAppEvent(result, registryName, healthCheckName);
    return result;
}
项目:runrightfast-vertx    文件:HealthChecksServiceImpl.java   
@Override
public Set<String> getRegistryNames() {
    return SharedHealthCheckRegistries.names();
}
项目:runrightfast-vertx    文件:RunRightFastVerticle.java   
/**
 * Performs the following:
 *
 * <ol>
 * <li>initializes the metric registry
 * <li>initializes the healthcheck regsistry
 * </ol>
 *
 * @param vertx Vertx
 * @param context Context
 */
@Override
public final void init(final Vertx vertx, final Context context) {
    super.init(vertx, context);
    this.metricRegistry = SharedMetricRegistries.getOrCreate(getRunRightFastVerticleId().toString());
    this.healthCheckRegistry = SharedHealthCheckRegistries.getOrCreate(getRunRightFastVerticleId().toString());
    this.instanceId = instanceSequence.incrementAndGet();
    this.verticleInstanceId = new RunRightFastVerticleInstanceId(getRunRightFastVerticleId(), instanceId, context.deploymentID());
    info.log("init", () -> lifeCycleMsg("initialized"));
}