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))
- Alphabetic
- By Inheritance
- StreamingStatsFilter
- SimpleFilter
- Filter
- Function2
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new StreamingStatsFilter(stats: StatsReceiver, exceptionStatsHandler: ExceptionStatsHandler, nowMillis: () => Long = Stopwatch.systemMillis)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- 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
- 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
- def andThen(service: Service[Request, Response]): Service[Request, Response]
Terminates a filter chain in a Service.
- 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.
- 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 be 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
- def andThenIf[Req2 >: Request, Rep2 <: Response](conditional: Boolean, filter: 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 be useful if you are statically wiring together filter chains based on a configuration file, for instance.
- conditional
a boolean value indicating whether the filter should be included in the filter chain.
- filter
the filter to be conditionally included.
- Definition Classes
- Filter
- 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
- StreamingStatsFilter → Filter → Function2
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def curried: (Request) => (Service[Request, Response]) => Future[Response]
- Definition Classes
- Function2
- Annotations
- @unspecialized()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- Filter → Function2 → AnyRef → Any
- def tupled: ((Request, Service[Request, Response])) => Future[Response]
- Definition Classes
- Function2
- Annotations
- @unspecialized()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()