Class: RailsApiBenchmark::Core

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/rails_api_benchmark/core.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Logging

included, #logger

Constructor Details

#initializeCore

Returns a new instance of Core.



11
12
13
14
15
16
# File 'lib/rails_api_benchmark/core.rb', line 11

def initialize
  @config = RailsApiBenchmark.config
  @resultset = ResultSet.new
  init_files
  write_index
end

Class Method Details

.runObject



7
8
9
# File 'lib/rails_api_benchmark/core.rb', line 7

def self.run
  new.run
end

Instance Method Details

#runObject



18
19
20
21
22
23
24
25
26
# File 'lib/rails_api_benchmark/core.rb', line 18

def run
  @config.routes.each do |route|
    e = Endpoint.new(route)
    res = e.run_benchmark
    @resultset.add(e, res)
  end
  @resultset.compute_relative_speed
  write_results
end