Class: RailsRunner::Endpoint

Inherits:
Object
  • Object
show all
Includes:
Beefcake::Message
Defined in:
lib/rails_runner/messages/endpoint.rb

Instance Method Summary collapse

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_errorObject



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

#countsObject



27
28
29
# File 'lib/rails_runner/messages/endpoint.rb', line 27

def counts
  @times.values
end

#timesObject



23
24
25
# File 'lib/rails_runner/messages/endpoint.rb', line 23

def times
  @times.keys
end