Class: QaServer::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/qa_server/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#display_historical_datatable=(value) ⇒ Object (writeonly)

Displays a datatable of historical test data when true

Parameters:

  • display (Boolean)

    history datatable when true



14
15
16
# File 'lib/qa_server/configuration.rb', line 14

def display_historical_datatable=(value)
  @display_historical_datatable = value
end

#display_historical_graph=(value) ⇒ Object (writeonly)

Displays a graph of historical test data when true

Parameters:

  • display (Boolean)

    history graph when true



6
7
8
# File 'lib/qa_server/configuration.rb', line 6

def display_historical_graph=(value)
  @display_historical_graph = value
end

#display_performance_datatable=(value) ⇒ Object (writeonly)

Displays a datatable of performance test data when true

Parameters:

  • display (Boolean)

    performance datatable when true



67
68
69
# File 'lib/qa_server/configuration.rb', line 67

def display_performance_datatable=(value)
  @display_performance_datatable = value
end

#display_performance_graph=(value) ⇒ Object (writeonly)

Displays a graph of performance test data when true

Parameters:

  • display (Boolean)

    performance graph when true



22
23
24
# File 'lib/qa_server/configuration.rb', line 22

def display_performance_graph=(value)
  @display_performance_graph = value
end

Additional menu items to add to the main navigation menu's set of left justified menu items

Examples:

[
  { label: 'New Item Label', url: 'http://new.item/one' },
  { label: '2nd New Item Label', url: 'http://new.item/two' }
]

Parameters:

  • array (Array<Hash<String,String>>)

    of menu items to append with hash key = menu item label to display and hash value = URL for the menu item link



101
102
103
# File 'lib/qa_server/configuration.rb', line 101

def navmenu_extra_leftitems
  @navmenu_extra_leftitems
end

#performance_datatable_default_time_periodObject



76
77
78
# File 'lib/qa_server/configuration.rb', line 76

def performance_datatable_default_time_period
  @performance_datatable_default_time_period ||= :year
end

#performance_datatable_max_thresholdObject



83
84
85
# File 'lib/qa_server/configuration.rb', line 83

def performance_datatable_max_threshold
  @performance_datatable_max_threshold ||= 1500
end

#performance_datatable_warning_thresholdObject



90
91
92
# File 'lib/qa_server/configuration.rb', line 90

def performance_datatable_warning_threshold
  @performance_datatable_warning_threshold ||= 1000
end

#performance_graph_default_time_periodObject



61
62
63
# File 'lib/qa_server/configuration.rb', line 61

def performance_graph_default_time_period
  @performance_graph_default_time_period ||= :month
end

#performance_graph_load_colorObject



46
47
48
# File 'lib/qa_server/configuration.rb', line 46

def performance_graph_load_color
  @performance_graph_load_color ||= '#E8DCD3'
end

#performance_normalization_colorObject



54
55
56
# File 'lib/qa_server/configuration.rb', line 54

def performance_normalization_color
  @performance_normalization_color ||= '#CCBE9F'
end

#performance_retrieve_colorObject



38
39
40
# File 'lib/qa_server/configuration.rb', line 38

def performance_retrieve_color
  @performance_retrieve_color ||= '#ABC3C9'
end

#performance_y_axis_maxObject



30
31
32
# File 'lib/qa_server/configuration.rb', line 30

def performance_y_axis_max
  @performance_y_axis_max ||= 4000
end

Instance Method Details

#display_historical_datatable?Boolean

Returns:

  • (Boolean)


15
16
17
18
# File 'lib/qa_server/configuration.rb', line 15

def display_historical_datatable?
  return @display_historical_datatable unless @display_historical_datatable.nil?
  @display_historical_datatable = true
end

#display_historical_graph?Boolean

Returns:

  • (Boolean)


7
8
9
10
# File 'lib/qa_server/configuration.rb', line 7

def display_historical_graph?
  return @display_historical_graph unless @display_historical_graph.nil?
  @display_historical_graph = false
end

#display_performance_datatable?Boolean

Returns:

  • (Boolean)


68
69
70
71
# File 'lib/qa_server/configuration.rb', line 68

def display_performance_datatable?
  return @display_performance_datatable unless @display_performance_datatable.nil?
  @display_performance_datatable = true
end

#display_performance_graph?Boolean

Returns:

  • (Boolean)


23
24
25
26
# File 'lib/qa_server/configuration.rb', line 23

def display_performance_graph?
  return @display_performance_graph unless @display_performance_graph.nil?
  @display_performance_graph = false
end

Get the one and only instance of the navigation menu presenter used to construct the main navigation menu. To extend, set additional navigation menu items using #navmenu_extra_leftitems



105
106
107
108
109
110
# File 'lib/qa_server/configuration.rb', line 105

def navmenu_presenter
  return @navmenu_presenter if @navmenu_presenter.present?
  @navmenu_presenter ||= QaServer::NavmenuPresenter.new
  @navmenu_presenter.append_leftmenu_items(navmenu_extra_leftitems)
  @navmenu_presenter
end

#performance_trackerObject



112
113
114
115
116
# File 'lib/qa_server/configuration.rb', line 112

def performance_tracker
  @performance_tracker ||= File.new('log/performance.csv', 'w').tap do |f|
    f.puts('action, http request, load graph, normalization, TOTAL, data size, authority')
  end
end