ResponseTiming

class Object
trait Matchable
class Any

Value members

Concrete methods

def apply[F[_]](http: HttpApp[F], timeUnit: TimeUnit, headerName: CIString)(F: Sync[F], clock: Clock[F]): HttpApp[F]

Simple middleware for adding a custom header with timing information to a response.

Simple middleware for adding a custom header with timing information to a response.

This middleware captures the time starting from when the request headers are parsed and supplied to the wrapped service and ending when the response is started. Metrics middleware, like this one, work best as the outer layer to ensure work done by other middleware is also included.

Value Params
headerName

the name to use for the header containing the timing info

http

HttpApp to transform

timeUnit

the units of measure for this timing