public class MetricsServlet
extends javax.servlet.http.HttpServlet
application/json response.| Modifier and Type | Class and Description |
|---|---|
static class |
MetricsServlet.ContextListener
An abstract
ServletContextListener which allows you to programmatically inject the
MetricRegistry, rate and duration units, and allowed origin for
MetricsServlet. |
| Modifier and Type | Field and Description |
|---|---|
static String |
ALLOWED_ORIGIN |
protected String |
allowedOrigin |
static String |
CALLBACK_PARAM |
static String |
DURATION_UNIT |
protected String |
jsonpParamName |
protected com.fasterxml.jackson.databind.ObjectMapper |
mapper |
static String |
METRIC_FILTER |
static String |
METRICS_REGISTRY |
static String |
RATE_UNIT |
protected com.codahale.metrics.MetricRegistry |
registry |
static String |
SHOW_SAMPLES |
| Constructor and Description |
|---|
MetricsServlet() |
MetricsServlet(com.codahale.metrics.MetricRegistry registry) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
protected com.fasterxml.jackson.databind.ObjectWriter |
getWriter(javax.servlet.http.HttpServletRequest request) |
void |
init(javax.servlet.ServletConfig config) |
protected TimeUnit |
parseTimeUnit(String value,
TimeUnit defaultValue) |
protected void |
setupMetricsModule(javax.servlet.ServletContext context) |
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, servicepublic static final String RATE_UNIT
public static final String DURATION_UNIT
public static final String SHOW_SAMPLES
public static final String METRICS_REGISTRY
public static final String ALLOWED_ORIGIN
public static final String METRIC_FILTER
public static final String CALLBACK_PARAM
protected String allowedOrigin
protected String jsonpParamName
protected transient com.codahale.metrics.MetricRegistry registry
protected transient com.fasterxml.jackson.databind.ObjectMapper mapper
public MetricsServlet()
public MetricsServlet(com.codahale.metrics.MetricRegistry registry)
public void init(javax.servlet.ServletConfig config)
throws javax.servlet.ServletException
init in interface javax.servlet.Servletinit in class javax.servlet.GenericServletjavax.servlet.ServletExceptionprotected void setupMetricsModule(javax.servlet.ServletContext context)
protected void doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
IOException
doGet in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionprotected com.fasterxml.jackson.databind.ObjectWriter getWriter(javax.servlet.http.HttpServletRequest request)
Copyright © 2011. All rights reserved.