Permalink
Browse files

hook up default deadlock healthcheck

  • Loading branch information...
jdillon committed Mar 19, 2013
1 parent 010d992 commit a3d5801132e551bcbea0069881abb559cabc54ac
Showing with 9 additions and 6 deletions.
  1. +9 −6 nexus-webapp/src/main/java/org/sonatype/nexus/webapp/MetricsModule.java
@@ -14,6 +14,7 @@
import com.yammer.metrics.reporting.MetricsServlet;
import com.yammer.metrics.reporting.PingServlet;
import com.yammer.metrics.reporting.ThreadDumpServlet;
+import com.yammer.metrics.util.DeadlockHealthCheck;
import com.yammer.metrics.web.DefaultWebappMetricsFilter;
import javax.inject.Named;
@@ -34,21 +35,23 @@ protected void configure() {
{
@Override
protected void configureServlets() {
+ Clock clock = Clock.defaultClock();
+ bind(Clock.class).toInstance(clock);
+
+ VirtualMachineMetrics virtualMachineMetrics = VirtualMachineMetrics.getInstance();
+ bind(VirtualMachineMetrics.class).toInstance(virtualMachineMetrics);
+
JsonFactory jsonFactory = new JsonFactory(new ObjectMapper());
bind(JsonFactory.class).toInstance(jsonFactory);
HealthCheckRegistry healthCheckRegistry = HealthChecks.defaultRegistry();
bind(HealthCheckRegistry.class).toInstance(healthCheckRegistry);
+ healthCheckRegistry.register(new DeadlockHealthCheck(virtualMachineMetrics));
+
MetricsRegistry metricsRegistry = Metrics.defaultRegistry();
bind(MetricsRegistry.class).toInstance(metricsRegistry);
- Clock clock = Clock.defaultClock();
- bind(Clock.class).toInstance(clock);
-
- VirtualMachineMetrics virtualMachineMetrics = VirtualMachineMetrics.getInstance();
- bind(VirtualMachineMetrics.class).toInstance(virtualMachineMetrics);
-
serve("/internal/ping").with(new PingServlet());
serve("/internal/threads").with(new ThreadDumpServlet(virtualMachineMetrics));

0 comments on commit a3d5801

Please sign in to comment.