public MetricsResource(restx.common.metrics.api.MetricRegistry metricRegistry, restx.common.metrics.api.health.HealthCheckRegistry healthCheckRegistry) {
if (!(metricRegistry instanceof CodahaleMetricRegistry)){
throw new IllegalStateException("restx-monitor-admin expects that module restx-monitor-codahale is loaded");
}
CodahaleMetricRegistry codahaleMetricRegistry = (CodahaleMetricRegistry) metricRegistry;
CodahaleHealthCheckRegistry codahaleHealthCheckRegistry = (CodahaleHealthCheckRegistry) healthCheckRegistry;
this.metrics = codahaleMetricRegistry.getCodahaleMetricRegistry();
this.healthChecks = codahaleHealthCheckRegistry.getCodahaleHealthCheckRegistry();
threadDump = new ThreadDump(ManagementFactory.getThreadMXBean());
}