class Async::HTTP::Statistics
Tracks response timing statistics including time to first byte and total duration.
def self.start
Start tracking statistics from the current time.
def self.start self.new(Clock.now) end
def initialize(start_time)
Initialize the statistics tracker.
def initialize(start_time) @start_time = start_time end
def wrap(response, &block)
@parameter response [Protocol::HTTP::Response] The response to wrap.
Wrap a response body with a statistics-collecting wrapper.
def wrap(response, &block) if response and response.body response.body = Body::Statistics.new(@start_time, response.body, block) end return response end