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.



34
35
36
# File 'lib/async/http/statistics.rb', line 34

def initialize(start_time)
	@start_time = start_time
end

Class Method Details

.startObject



30
31
32
# File 'lib/async/http/statistics.rb', line 30

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

Instance Method Details

#wrap(response, &block) ⇒ Object



38
39
40
41
42
43
44
# File 'lib/async/http/statistics.rb', line 38

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