Class VertxHttpServerMetrics

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

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

      • log

        static final org.jboss.logging.Logger log
      • nameWebsocketConnections

        final String nameWebsocketConnections
      • nameHttpServerPush

        final String nameHttpServerPush
      • nameHttpServerRequests

        final String nameHttpServerRequests
      • activeRequests

        final LongAdder activeRequests
    • Constructor Detail

      • VertxHttpServerMetrics

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

      • responsePushed

        public HttpRequestMetric responsePushed​(io.micrometer.core.instrument.LongTaskTimer.Sample 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,​io.micrometer.core.instrument.LongTaskTimer.Sample>
        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,​io.micrometer.core.instrument.LongTaskTimer.Sample>
      • 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,​io.micrometer.core.instrument.LongTaskTimer.Sample>
        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,​io.micrometer.core.instrument.LongTaskTimer.Sample>
        Parameters:
        requestMetric - a RequestMetricContext or null
        response - the http server response
        bytesWritten - bytes written
      • connected

        public io.micrometer.core.instrument.LongTaskTimer.Sample connected​(io.micrometer.core.instrument.LongTaskTimer.Sample sample,
                                                                            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,​io.micrometer.core.instrument.LongTaskTimer.Sample>
        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,​io.micrometer.core.instrument.LongTaskTimer.Sample>
        Parameters:
        websocketMetric - a LongTaskTimer.Sample or null