Class: Async::HTTP::Statistics
- Inherits:
- 
      Object
      
        - Object
- Async::HTTP::Statistics
 
- Defined in:
- lib/async/http/statistics.rb
Class Method Summary collapse
Instance Method Summary collapse
- 
  
    
      #initialize(start_time)  ⇒ Statistics 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of Statistics. 
- #wrap(response, &block) ⇒ Object
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
.start ⇒ Object
| 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 |