Package io.smallrye.metrics
Class MetricsRequestHandler
- java.lang.Object
-
- io.smallrye.metrics.MetricsRequestHandler
-
@ApplicationScoped public class MetricsRequestHandler extends Object
- Author:
- Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
Date: 6/25/18
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceMetricsRequestHandler.ResponderResponder is used by MetricsRequestHandler to return a response to the caller
-
Constructor Summary
Constructors Constructor Description MetricsRequestHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendCorsHeaders(boolean value)voidhandleRequest(String requestPath, String contextRoot, String method, Stream<String> acceptHeaders, MetricsRequestHandler.Responder responder)voidhandleRequest(String requestPath, String method, Stream<String> acceptHeaders, MetricsRequestHandler.Responder responder)
-
-
-
Method Detail
-
appendCorsHeaders
public void appendCorsHeaders(boolean value)
-
handleRequest
public void handleRequest(String requestPath, String method, Stream<String> acceptHeaders, MetricsRequestHandler.Responder responder) throws IOException
- Parameters:
requestPath- e.g. request.getRequestURI for an HttpServletmethod- http method (GET, POST, etc)acceptHeaders- accepted content typesresponder- a method that returns a response to the caller. SeeMetricsRequestHandler.Responder- Throws:
IOException- rethrows IOException if thrown by the responder You can find example usage in the tests, in io.smallrye.metrics.tck.rest.MetricsHttpServlet
-
handleRequest
public void handleRequest(String requestPath, String contextRoot, String method, Stream<String> acceptHeaders, MetricsRequestHandler.Responder responder) throws IOException
- Parameters:
requestPath- e.g. request.getRequestURI for an HttpServletcontextRoot- the root at which Metrics are exposed, usually "/metrics"method- http method (GET, POST, etc)acceptHeaders- accepted content typesresponder- a method that returns a response to the caller. SeeMetricsRequestHandler.Responder- Throws:
IOException- rethrows IOException if thrown by the responder You can find example usage in the tests, in io.smallrye.metrics.tck.rest.MetricsHttpServlet
-
-