Packages

class StreamingStatsFilter extends SimpleFilter[Request, Response]

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))
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. StreamingStatsFilter
  2. SimpleFilter
  3. Filter
  4. Function2
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new StreamingStatsFilter(stats: StatsReceiver, exceptionStatsHandler: ExceptionStatsHandler, nowMillis: () ⇒ Long = Stopwatch.systemMillis)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def agnosticAndThen(next: TypeAgnostic): Filter[Request, Response, Request, Response]

    Convert the Filter.TypeAgnostic filter to a Filter and chain it with andThen.

    Convert the Filter.TypeAgnostic filter to a Filter and chain it with andThen.

    Definition Classes
    Filter
  5. def andThen(factory: ServiceFactory[Request, Response]): ServiceFactory[Request, Response]

    Terminates a filter chain in a ServiceFactory.

    Terminates a filter chain in a ServiceFactory. For example,

    myFilter.andThen(myServiceFactory)
    factory

    a service factory that takes the output request type and the input response type.

    Definition Classes
    Filter
  6. def andThen(service: Service[Request, Response]): Service[Request, Response]

    Terminates a filter chain in a Service.

    Terminates a filter chain in a Service. For example,

    myFilter.andThen(myService)
    service

    a service that takes the output request type and the input response type.

    Definition Classes
    Filter
  7. def andThen[Req2, Rep2](next: Filter[Request, Response, Req2, Rep2]): Filter[Request, Response, Req2, Rep2]

    Chains a series of filters together:

    Chains a series of filters together:

    myModularService = handleExceptions.andThen(thrift2Pojo.andThen(parseString))
    next

    another filter to follow after this one

    Definition Classes
    Filter
    Note

    synchronously thrown exceptions in the underlying service are automatically lifted into Future.exception.

  8. def andThenIf[Req2 >: Request, Rep2 <: Response](condAndFilter: (Boolean, Filter[Request, Response, Req2, Rep2])): Filter[Request, Response, Req2, Rep2]

    Conditionally propagates requests down the filter chain.

    Conditionally propagates requests down the filter chain. This may useful if you are statically wiring together filter chains based on a configuration file, for instance.

    condAndFilter

    a tuple of boolean and filter.

    Definition Classes
    Filter
  9. def apply(request: Request, service: Service[Request, Response]): Future[Response]

    This is the method to override/implement to create your own Filter.

    This is the method to override/implement to create your own Filter.

    request

    the input request type

    service

    a service that takes the output request type and the input response type

    Definition Classes
    StreamingStatsFilterFilter → Function2
  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  12. def curried: (Request) ⇒ (Service[Request, Response]) ⇒ Future[Response]
    Definition Classes
    Function2
    Annotations
    @unspecialized()
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  23. def toString(): String
    Definition Classes
    Filter → Function2 → AnyRef → Any
  24. def tupled: ((Request, Service[Request, Response])) ⇒ Future[Response]
    Definition Classes
    Function2
    Annotations
    @unspecialized()
  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from SimpleFilter[Request, Response]

Inherited from Filter[Request, Response, Request, Response]

Inherited from (Request, Service[Request, Response]) ⇒ Future[Response]

Inherited from AnyRef

Inherited from Any

Ungrouped