Class: RailsRunner::Endpoint
- Inherits:
-
Object
- Object
- RailsRunner::Endpoint
- Includes:
- Beefcake::Message
- Defined in:
- lib/rails_runner/messages/endpoint.rb
Instance Method Summary collapse
- #add_error ⇒ Object
- #add_time(time) ⇒ Object
- #counts ⇒ Object
-
#initialize(*args) ⇒ Endpoint
constructor
A new instance of Endpoint.
- #times ⇒ Object
Constructor Details
#initialize(*args) ⇒ Endpoint
Returns a new instance of Endpoint.
9 10 11 12 13 |
# File 'lib/rails_runner/messages/endpoint.rb', line 9 def initialize(*args) super @errors = 0 @times = Hash.new { |h, k| h[k] = 0 } end |
Instance Method Details
#add_error ⇒ Object
19 20 21 |
# File 'lib/rails_runner/messages/endpoint.rb', line 19 def add_error @errors += 1 end |
#add_time(time) ⇒ Object
15 16 17 |
# File 'lib/rails_runner/messages/endpoint.rb', line 15 def add_time(time) @times[time.to_i] += 1 end |
#counts ⇒ Object
27 28 29 |
# File 'lib/rails_runner/messages/endpoint.rb', line 27 def counts @times.values end |
#times ⇒ Object
23 24 25 |
# File 'lib/rails_runner/messages/endpoint.rb', line 23 def times @times.keys end |