Package

com.twitter.finagle.http

filter

Permalink

package filter

Visibility
  1. Public
  2. All

Type Members

  1. class AddResponseHeadersFilter extends SimpleFilter[Request, Response]

    Permalink
  2. class CommonLogFormatter extends LogFormatter

    Permalink

    Apache-style common log formatter

  3. class ExceptionFilter[REQUEST <: Request] extends SimpleFilter[REQUEST, Response]

    Permalink

    General purpose exception filter.

    General purpose exception filter.

    Uncaught exceptions are converted to 500 Internal Server Error. Cancellations are converted to 499 Client Closed Request. 499 is an Nginx extension for exactly this situation, see: https://trac.nginx.org/nginx/browser/nginx/trunk/src/http/ngx_http_request.h

  4. class HeadFilter[Req <: Request] extends SimpleFilter[Req, Response]

    Permalink

    HEAD filter.

    HEAD filter. Implements HEAD by converting to a GET.

  5. class JsonpFilter[Req <: Request] extends SimpleFilter[Req, Response]

    Permalink

    JSONP (callback) filter

    JSONP (callback) filter

    Wrap JSON content in <callback>(<content>);

    See: https://en.wikipedia.org/wiki/JSONP

  6. trait LogFormatter extends filter.LogFormatter[Request, Response]

    Permalink
  7. class LoggingFilter[REQUEST <: Request] extends SimpleFilter[REQUEST, Response] with filter.LoggingFilter[REQUEST, Response]

    Permalink

    Logging filter.

    Logging filter.

    Logs all requests according to formatter.

  8. class MethodRequiredFilter[REQUEST <: Request] extends SimpleFilter[REQUEST, Response]

    Permalink

    Method required filter.

    Method required filter.

    Respond with 405 Method Not Allowed error if method not in supported method list.

  9. class StatsFilter[REQUEST <: Request] extends SimpleFilter[REQUEST, Response]

    Permalink

    Statistic filter.

    Statistic filter.

    Add counters: status.[code] status.[class] And metrics: time.[code] time.[class]

  10. class StreamingStatsFilter extends SimpleFilter[Request, Response]

    Permalink

    A filter to export statistics for HTTP streaming requests and responses.

    A filter to export statistics for HTTP streaming requests and responses. A streaming request/response is an HTTP request/response with isChunked set to true.

    This filter is included in HTTP stack by default, all metrics defined in this filter are only populated for HTTP streaming requests/responses.

    Stats: ---------------Request Stream------------

    • stream/request/duration_ms: A histogram of the duration of the lifetime of request streams, from the time a stream is initialized until it's closed, in milliseconds. ---------------Response Stream-----------
    • stream/response/duration_ms: A histogram of the duration of the lifetime of response streams, from the time a stream is initialized until it's closed, in milliseconds. Counters: ---------------Request Stream------------
    • stream/request/closed: A counter of the number of closed request streams.
    • stream/request/failures A counter of the number of times any failure has been observed in the middle of a request stream.
    • stream/request/failures/<exception_name>: A counter of the number of times a specific exception has been thrown in the middle of a request stream.
    • stream/request/opened: A counter of the number of opened request streams. ---------------Response Stream-----------
    • stream/response/closed: A counter of the number of closed response streams.
    • stream/response/failures A counter of the number of times any failure has been observed in the middle of a response stream.
    • stream/response/failures/<exception_name>: A counter of the number of times a specific exception has been thrown in the middle of a response stream.
    • stream/response/opened: A counter of the number of opened response streams. Gauges: ---------------Request Stream------------
    • stream/request/pending: A gauge of the number of pending request streams. ---------------Response Stream------------
    • stream/response/pending: A gauge of the number of pending response streams.

    You could derive the streaming success rate of:

    • the total number of streams number of successful streams divided by number of total streams
    • closed streams number of successful streams divided by number of closed streams Here we assume a success stream as a stream terminated without an exception or a stream that has not terminated yet.

    Take request stream as an example, assuming your counters are not "latched", which means that their values are monotonically increasing:

    • Success rate of total number of streams: 1 - (rated_counter(stream/request/failures) / (gauge(stream/request/pending) + rated_counter(stream/request/closed)))
    • Success rate of number of closed streams: 1 - (rated_counter(stream/request/failures) / rated_counter(stream/request/closed))

Value Members

  1. object ClientNackFilter

    Permalink
  2. object Cors

    Permalink

    Implements https://www.w3.org/TR/cors/

  3. object CorsFilter

    Permalink

    Adds headers to support Cross-origin resource sharing.

    Adds headers to support Cross-origin resource sharing.

    This is here for backwards compatibility. You should probably use Cors.HttpFilter directly.

  4. object ExceptionFilter extends ExceptionFilter[Request]

    Permalink
  5. object HeadFilter extends HeadFilter[Request]

    Permalink
  6. object JsonpFilter extends JsonpFilter[Request]

    Permalink
  7. object LogFormatter

    Permalink
  8. object LoggingFilter extends LoggingFilter[Request]

    Permalink
  9. object MethodRequiredFilter extends MethodRequiredFilter[Request]

    Permalink
  10. object StatsFilter

    Permalink
  11. object StreamingStatsFilter

    Permalink

Ungrouped