Class: Autotuner::SystemContext

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSystemContext

Returns a new instance of SystemContext.



7
8
9
# File 'lib/autotuner/system_context.rb', line 7

def initialize
  @request_time_data = DataStructure::DataPoints.new(Configuration::DATA_POINTS_COUNT)
end

Instance Attribute Details

#request_time_dataObject (readonly)

Returns the value of attribute request_time_data.



5
6
7
# File 'lib/autotuner/system_context.rb', line 5

def request_time_data
  @request_time_data
end

Instance Method Details

#debug_stateObject



15
16
17
18
19
# File 'lib/autotuner/system_context.rb', line 15

def debug_state
  {
    request_time_data: @request_time_data.debug_state,
  }
end

#update(request_context) ⇒ Object



11
12
13
# File 'lib/autotuner/system_context.rb', line 11

def update(request_context)
  @request_time_data.insert(request_context.request_time)
end