Class VertxHttpServerMetrics

  • All Implemented Interfaces:
    io.vertx.core.spi.metrics.HttpServerMetrics<HttpRequestMetric,​io.micrometer.core.instrument.LongTaskTimer.Sample,​Map<String,​Object>>, io.vertx.core.spi.metrics.Metrics, io.vertx.core.spi.metrics.NetworkMetrics<Map<String,​Object>>, io.vertx.core.spi.metrics.TCPMetrics<Map<String,​Object>>

    public class VertxHttpServerMetrics
    extends VertxTcpMetrics
    implements io.vertx.core.spi.metrics.HttpServerMetrics<HttpRequestMetric,​io.micrometer.core.instrument.LongTaskTimer.Sample,​Map<String,​Object>>
    HttpServerMetrics
    • R for Request metric -- RequestMetricContext
    • W for Websocket metric -- LongTaskTimer sample
    • S for Socket metric -- Map
    • Constructor Detail

      • VertxHttpServerMetrics

        VertxHttpServerMetrics​(io.micrometer.core.instrument.MeterRegistry registry,
                               HttpBinderConfiguration config)
    • Method Detail

      • responsePushed

        public HttpRequestMetric responsePushed​(Map<String,​Object> socketMetric,
                                                io.vertx.core.http.HttpMethod method,
                                                String uri,
                                                io.vertx.core.spi.observability.HttpResponse response)
        Called when an HTTP server response is pushed.
        Specified by:
        responsePushed in interface io.vertx.core.spi.metrics.HttpServerMetrics<HttpRequestMetric,​io.micrometer.core.instrument.LongTaskTimer.Sample,​Map<String,​Object>>
        Parameters:
        socketMetric - a Map for socket metric context or null
        method - the pushed response method
        uri - the pushed response uri
        response - the http server response
        Returns:
        a RequestMetricContext
      • requestRouted

        public void requestRouted​(HttpRequestMetric requestMetric,
                                  String route)
        Specified by:
        requestRouted in interface io.vertx.core.spi.metrics.HttpServerMetrics<HttpRequestMetric,​io.micrometer.core.instrument.LongTaskTimer.Sample,​Map<String,​Object>>
      • requestReset

        public void requestReset​(HttpRequestMetric requestMetric)
        Called when the http server request couldn't complete successfully, for instance the connection was closed before the response was sent.
        Specified by:
        requestReset in interface io.vertx.core.spi.metrics.HttpServerMetrics<HttpRequestMetric,​io.micrometer.core.instrument.LongTaskTimer.Sample,​Map<String,​Object>>
        Parameters:
        requestMetric - a RequestMetricContext or null
      • responseEnd

        public void responseEnd​(HttpRequestMetric requestMetric,
                                io.vertx.core.spi.observability.HttpResponse response,
                                long bytesWritten)
        Called when an HTTP server response has ended.
        Specified by:
        responseEnd in interface io.vertx.core.spi.metrics.HttpServerMetrics<HttpRequestMetric,​io.micrometer.core.instrument.LongTaskTimer.Sample,​Map<String,​Object>>
        Parameters:
        requestMetric - a RequestMetricContext or null
        response - the http server response
        bytesWritten - bytes written
      • connected

        public io.micrometer.core.instrument.LongTaskTimer.Sample connected​(Map<String,​Object> socketMetric,
                                                                            HttpRequestMetric requestMetric,
                                                                            io.vertx.core.http.ServerWebSocket serverWebSocket)
        Called when a server web socket connects.
        Specified by:
        connected in interface io.vertx.core.spi.metrics.HttpServerMetrics<HttpRequestMetric,​io.micrometer.core.instrument.LongTaskTimer.Sample,​Map<String,​Object>>
        Parameters:
        socketMetric - a Map for socket metric context or null
        requestMetric - a RequestMetricContext or null
        serverWebSocket - the server web socket
        Returns:
        a LongTaskTimer.Sample or null
      • disconnected

        public void disconnected​(io.micrometer.core.instrument.LongTaskTimer.Sample websocketMetric)
        Called when the server web socket has disconnected.
        Specified by:
        disconnected in interface io.vertx.core.spi.metrics.HttpServerMetrics<HttpRequestMetric,​io.micrometer.core.instrument.LongTaskTimer.Sample,​Map<String,​Object>>
        Parameters:
        websocketMetric - a LongTaskTimer.Sample or null