Class: Async::HTTP::Statistics

Inherits:
Object
  • Object
show all
Defined in:
lib/async/http/statistics.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(start_time) ⇒ Statistics

Returns a new instance of Statistics.



17
18
19
# File 'lib/async/http/statistics.rb', line 17

def initialize(start_time)
	@start_time = start_time
end

Class Method Details

.startObject



13
14
15
# File 'lib/async/http/statistics.rb', line 13

def self.start
	self.new(Clock.now)
end

Instance Method Details

#wrap(response, &block) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/async/http/statistics.rb', line 21

def wrap(response, &block)
	if response and response.body
		response.body = Body::Statistics.new(@start_time, response.body, block)
	end
	
	return response
end