io.vertx.core.spi.metrics

## Interface HttpServerMetrics<R,W,S>

- All Superinterfaces:
    Metrics, NetworkMetrics<S>, TCPMetrics<S>

      public interface HttpServerMetrics<R,W,S>
      extends TCPMetrics<S>

  The http server metrics SPI that Vert.x will use to call when each http server event occurs.

  The thread model for the http server metrics depends on the actual context thats started the server.

  ### Event loop context

  Unless specified otherwise, all the methods on this object including the methods inherited from the super interfaces are invoked with the thread of the http server and therefore are the same than the `VertxMetrics` `createMetrics` method that created and returned this metrics object.

  ### Worker context

  Unless specified otherwise, all the methods on this object including the methods inherited from the super interfaces are invoked with a worker thread.
  Author:
    Nick Scavelli

- - ### Field Summary

    - ### Fields inherited from interface io.vertx.core.spi.metrics.Metrics

      `DISABLE_METRICS_PROPERTY_NAME, METRICS_ENABLED`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `W` | `connected(S socketMetric, ServerWebSocket serverWebSocket)` Called when a server web socket connects.
    `void` | `disconnected(W serverWebSocketMetric)` Called when the server web socket has disconnected.
    `R` | `requestBegin(S socketMetric, HttpServerRequest request)` Called when an http server request begins.
    `void` | `requestReset(R requestMetric)` Called when the http server request couldn't complete successfully, for instance the connection was closed before the response was sent.
    `void` | `responseEnd(R requestMetric, HttpServerResponse response)` Called when an http server response has ended.
    `R` | `responsePushed(S socketMetric, HttpMethod method, String uri, HttpServerResponse response)` Called when an http server response is pushed.
    `W` | `upgrade(R requestMetric, ServerWebSocket serverWebSocket)` Called when an http server request is upgrade to a websocket.

    - ### Methods inherited from interface io.vertx.core.spi.metrics.TCPMetrics

      `connected, disconnected`

    - ### Methods inherited from interface io.vertx.core.spi.metrics.NetworkMetrics

      `bytesRead, bytesWritten, exceptionOccurred`

    - ### Methods inherited from interface io.vertx.core.spi.metrics.Metrics

      `close, isEnabled`

- - ### Method Detail

    - #### requestBegin

          R requestBegin(S socketMetric,
                         HttpServerRequest request)

      Called when an http server request begins. Vert.x will invoke `responseEnd(R, io.vertx.core.http.HttpServerResponse)` when the response has ended or `requestReset(R)` if the request/response has failed before.
      Parameters:
        `socketMetric` - the socket metric
        `request` - the http server reuqest
      Returns:
        the request metric

    - #### requestReset

          void requestReset(R requestMetric)

      Called when the http server request couldn't complete successfully, for instance the connection was closed before the response was sent.
      Parameters:
        `requestMetric` - the request metric

    - #### responsePushed

          R responsePushed(S socketMetric,
                           HttpMethod method,
                           String uri,
                           HttpServerResponse response)

      Called when an http server response is pushed.
      Parameters:
        `socketMetric` - the socket metric
        `method` - the pushed response method
        `uri` - the pushed response uri
        `response` - the http server response @return the request metric

    - #### responseEnd

          void responseEnd(R requestMetric,
                           HttpServerResponse response)

      Called when an http server response has ended.
      Parameters:
        `requestMetric` - the request metric
        `response` - the http server request

    - #### upgrade

          W upgrade(R requestMetric,
                    ServerWebSocket serverWebSocket)

      Called when an http server request is upgrade to a websocket.
      Parameters:
        `requestMetric` - the request metric
        `serverWebSocket` - the server web socket
      Returns:
        the server web socket metric

    - #### connected

          W connected(S socketMetric,
                      ServerWebSocket serverWebSocket)

      Called when a server web socket connects.
      Parameters:
        `socketMetric` - the socket metric
        `serverWebSocket` - the server web socket
      Returns:
        the server web socket metric

    - #### disconnected

          void disconnected(W serverWebSocketMetric)

      Called when the server web socket has disconnected.
      Parameters:
        `serverWebSocketMetric` - the server web socket metric

Copyright © 2017. All rights reserved.