Skip to content

Instantly share code, notes, and snippets.

@Sennahoi
Last active August 29, 2015 14:04
Show Gist options
  • Save Sennahoi/26b540b1e186690197af to your computer and use it in GitHub Desktop.
Save Sennahoi/26b540b1e186690197af to your computer and use it in GitHub Desktop.
MetricsServlet (metrics.codahale.com/) configuration
MetricRegistry metricRegistry = new MetricRegistry();
ctx.getServletContext().setAttribute("com.codahale.metrics.servlets.MetricsServlet.registry", metricRegistry);
<servlet>
<servlet-name>MetricsServlet</servlet-name>
<servlet-class>com.codahale.metrics.servlets.MetricsServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MetricsServlet</servlet-name>
<url-pattern>/metrics</url-pattern>
</servlet-mapping>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment