Class: Autotuner::RequestCollector

Inherits:
Object
  • Object
show all
Defined in:
lib/autotuner/request_collector.rb

Constant Summary collapse

HEURISTICS_POLLING_FREQUENCY =
100
DEBUG_EMIT_FREQUENCY =
1000

Instance Method Summary collapse

Constructor Details

#initializeRequestCollector

Returns a new instance of RequestCollector.



8
9
10
11
12
13
14
15
16
# File 'lib/autotuner/request_collector.rb', line 8

def initialize
  @request_count = 0

  @request_context = RequestContext.new

  @system_context = SystemContext.new

  @heuristics = Autotuner.supported_heuristics.map { |h| h.new(@system_context) }
end

Instance Method Details

#requestObject



18
19
20
21
22
23
24
# File 'lib/autotuner/request_collector.rb', line 18

def request
  before_request

  yield
ensure
  after_request
end