Class: QaServer::Configuration
- Inherits:
-
Object
- Object
- QaServer::Configuration
- Defined in:
- lib/qa_server/configuration.rb
Instance Attribute Summary collapse
-
#display_historical_datatable ⇒ Object
writeonly
Displays a datatable of historical test data when true.
-
#display_historical_graph ⇒ Object
writeonly
Displays a graph of historical test data when true.
-
#display_performance_datatable ⇒ Object
writeonly
Displays a datatable of performance test data when true.
-
#display_performance_graph ⇒ Object
writeonly
Displays a graph of performance test data when true.
- #max_performance_cache_size ⇒ Object
-
#navmenu_extra_leftitems ⇒ Object
Additional menu items to add to the main navigation menu’s set of left justified menu items.
- #performance_datatable_max_threshold ⇒ Object
- #performance_datatable_warning_threshold ⇒ Object
- #performance_graph_load_color ⇒ Object
- #performance_normalization_color ⇒ Object
- #performance_retrieve_color ⇒ Object
- #performance_y_axis_max ⇒ Object
- #preferred_time_zone_name ⇒ Object
-
#suppress_logging_performance_details ⇒ Object
(also: #suppress_logging_performance_datails=)
writeonly
Performance data is gathered on every incoming query.
-
#suppress_performance_gathering ⇒ Object
writeonly
Performance data is gathered on every incoming query.
- #up_down_data_mostly_up_threshold ⇒ Object
- #up_down_data_timeouts_max_threshold ⇒ Object
Instance Method Summary collapse
-
#disable_monitor_status_logging ⇒ Object
Disable logging of performance cache.
-
#disable_performance_cache_logging ⇒ Object
Disable logging of performance cache.
- #display_historical_datatable? ⇒ Boolean
- #display_historical_graph? ⇒ Boolean
- #display_performance_datatable? ⇒ Boolean
- #display_performance_graph? ⇒ Boolean
-
#enable_monitor_status_logging ⇒ Object
Enable logging of monitoring process.
-
#enable_performance_cache_logging ⇒ Object
Enable logging of performance cache.
-
#historical_datatable_default_time_period ⇒ Symbol
Historical datatable default time period.
-
#historical_datatable_default_time_period=(time_period) ⇒ Object
Historical datatable default time period.
-
#hour_offset_to_expire_cache ⇒ Integer
(also: #hour_offset_to_run_monitoring_tests)
Preferred hour to expire caches related to slow running calculations (e.g. monitoring tests, performance data).
-
#hour_offset_to_expire_cache=(offset) ⇒ Object
Set preferred hour to expire caches related to slow running calculations (e.g. monitoring tests, performance data).
-
#hour_offset_to_run_monitoring_tests=(offset) ⇒ Object
deprecated
Deprecated.
Use #hour_offset_to_expire_cache= instead.
-
#monitor_logger ⇒ Object
For internal use only.
-
#navmenu_presenter ⇒ Object
Get the one and only instance of the navigation menu presenter used to construct the main navigation menu.
-
#performance_cache ⇒ Object
For internal use only.
-
#performance_cache_logger ⇒ Object
For internal use only.
-
#performance_datatable_default_time_period ⇒ Symbol
Performance datatable default time period for calculating stats.
-
#performance_datatable_default_time_period=(time_period) ⇒ Object
Performance datatable default time period for calculating stats.
-
#performance_graph_default_time_period ⇒ Symbol
Performance graph default time period for all graphs.
-
#performance_graph_default_time_period=(time_period) ⇒ Object
Performance graph default time period for all graphs.
- #performance_tracker ⇒ Object
- #suppress_logging_performance_details? ⇒ Boolean (also: #suppress_logging_performance_datails, #suppress_logging_performance_datails?)
- #suppress_performance_gathering? ⇒ Boolean (also: #suppress_performance_gathering)
Instance Attribute Details
#display_historical_datatable=(value) ⇒ Object (writeonly)
Displays a datatable of historical test data when true
56 57 58 |
# File 'lib/qa_server/configuration.rb', line 56 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
48 49 50 |
# File 'lib/qa_server/configuration.rb', line 48 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
144 145 146 |
# File 'lib/qa_server/configuration.rb', line 144 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
92 93 94 |
# File 'lib/qa_server/configuration.rb', line 92 def display_performance_graph=(value) @display_performance_graph = value end |
#max_performance_cache_size ⇒ Object
231 232 233 |
# File 'lib/qa_server/configuration.rb', line 231 def max_performance_cache_size @max_performance_cache_size ||= convert_size_to_bytes(ENV['MAX_PERFORMANCE_CACHE_SIZE']) || 32.megabytes end |
#navmenu_extra_leftitems ⇒ Object
Additional menu items to add to the main navigation menu’s set of left justified menu items
185 186 187 |
# File 'lib/qa_server/configuration.rb', line 185 def @navmenu_extra_leftitems end |
#performance_datatable_max_threshold ⇒ Object
167 168 169 |
# File 'lib/qa_server/configuration.rb', line 167 def performance_datatable_max_threshold @performance_datatable_max_threshold ||= 1500 end |
#performance_datatable_warning_threshold ⇒ Object
174 175 176 |
# File 'lib/qa_server/configuration.rb', line 174 def performance_datatable_warning_threshold @performance_datatable_warning_threshold ||= 1000 end |
#performance_graph_load_color ⇒ Object
116 117 118 |
# File 'lib/qa_server/configuration.rb', line 116 def performance_graph_load_color @performance_graph_load_color ||= '#E8DCD3' end |
#performance_normalization_color ⇒ Object
124 125 126 |
# File 'lib/qa_server/configuration.rb', line 124 def performance_normalization_color @performance_normalization_color ||= '#CCBE9F' end |
#performance_retrieve_color ⇒ Object
108 109 110 |
# File 'lib/qa_server/configuration.rb', line 108 def performance_retrieve_color @performance_retrieve_color ||= '#ABC3C9' end |
#performance_y_axis_max ⇒ Object
100 101 102 |
# File 'lib/qa_server/configuration.rb', line 100 def performance_y_axis_max @performance_y_axis_max ||= 4000 end |
#preferred_time_zone_name ⇒ Object
8 9 10 |
# File 'lib/qa_server/configuration.rb', line 8 def preferred_time_zone_name @preferred_time_zone_name ||= 'Eastern Time (US & Canada)' end |
#suppress_logging_performance_details=(value) ⇒ Object (writeonly) Also known as: suppress_logging_performance_datails=
Performance data is gathered on every incoming query. Basic stats are logged from QA. Full stats are logged by QaServer and can eat up logging realestate. To suppress the logging of details, set this config to true.
216 217 218 |
# File 'lib/qa_server/configuration.rb', line 216 def suppress_logging_performance_details=(value) @suppress_logging_performance_details = value end |
#suppress_performance_gathering=(value) ⇒ Object (writeonly)
Performance data is gathered on every incoming query. If load is high, this can have a negative performance impact and may need to be suppressed. Performance stats will not be gathered when this config is true.
205 206 207 |
# File 'lib/qa_server/configuration.rb', line 205 def suppress_performance_gathering=(value) @suppress_performance_gathering = value end |
#up_down_data_mostly_up_threshold ⇒ Object
86 87 88 |
# File 'lib/qa_server/configuration.rb', line 86 def up_down_data_mostly_up_threshold @up_down_data_mostly_up_threshold ||= 0.95 end |
#up_down_data_timeouts_max_threshold ⇒ Object
79 80 81 |
# File 'lib/qa_server/configuration.rb', line 79 def up_down_data_timeouts_max_threshold @up_down_data_timeouts_max_threshold ||= 0.3 end |
Instance Method Details
#disable_monitor_status_logging ⇒ Object
Disable logging of performance cache
261 262 263 |
# File 'lib/qa_server/configuration.rb', line 261 def disable_monitor_status_logging monitor_logger.level = Logger::INFO end |
#disable_performance_cache_logging ⇒ Object
Disable logging of performance cache
246 247 248 |
# File 'lib/qa_server/configuration.rb', line 246 def disable_performance_cache_logging performance_cache_logger.level = Logger::INFO end |
#display_historical_datatable? ⇒ Boolean
57 58 59 60 |
# File 'lib/qa_server/configuration.rb', line 57 def display_historical_datatable? return @display_historical_datatable unless @display_historical_datatable.nil? @display_historical_datatable = true end |
#display_historical_graph? ⇒ Boolean
49 50 51 52 |
# File 'lib/qa_server/configuration.rb', line 49 def display_historical_graph? return @display_historical_graph unless @display_historical_graph.nil? @display_historical_graph = false end |
#display_performance_datatable? ⇒ Boolean
145 146 147 148 |
# File 'lib/qa_server/configuration.rb', line 145 def display_performance_datatable? return @display_performance_datatable unless @display_performance_datatable.nil? @display_performance_datatable = true end |
#display_performance_graph? ⇒ Boolean
93 94 95 96 |
# File 'lib/qa_server/configuration.rb', line 93 def display_performance_graph? return @display_performance_graph unless @display_performance_graph.nil? @display_performance_graph = false end |
#enable_monitor_status_logging ⇒ Object
Enable logging of monitoring process
256 257 258 |
# File 'lib/qa_server/configuration.rb', line 256 def enable_monitor_status_logging monitor_logger.level = Logger::DEBUG end |
#enable_performance_cache_logging ⇒ Object
Enable logging of performance cache
241 242 243 |
# File 'lib/qa_server/configuration.rb', line 241 def enable_performance_cache_logging performance_cache_logger.level = Logger::DEBUG end |
#historical_datatable_default_time_period ⇒ Symbol
Historical datatable default time period.
72 73 74 |
# File 'lib/qa_server/configuration.rb', line 72 def historical_datatable_default_time_period @historical_datatable_default_time_period ||= :year end |
#historical_datatable_default_time_period=(time_period) ⇒ Object
Historical datatable default time period.
65 66 67 68 |
# File 'lib/qa_server/configuration.rb', line 65 def historical_datatable_default_time_period=(time_period) raise ArgumentError, 'time_period must be one of :month, :year, or :all' unless [:month, :year, :all].include? time_period @historical_datatable_default_time_period = time_period end |
#hour_offset_to_expire_cache ⇒ Integer Also known as: hour_offset_to_run_monitoring_tests
Preferred hour to expire caches related to slow running calculations (e.g. monitoring tests, performance data)
25 26 27 |
# File 'lib/qa_server/configuration.rb', line 25 def hour_offset_to_expire_cache @hour_offset_to_expire_cache ||= 3 end |
#hour_offset_to_expire_cache=(offset) ⇒ Object
Set preferred hour to expire caches related to slow running calculations (e.g. monitoring tests, performance data)
18 19 20 21 |
# File 'lib/qa_server/configuration.rb', line 18 def hour_offset_to_expire_cache=(offset) raise ArgumentError, 'offset must be between 0 and 23' unless (0..23).cover? offset @hour_offset_to_expire_cache = offset end |
#hour_offset_to_run_monitoring_tests=(offset) ⇒ Object
Use #hour_offset_to_expire_cache= instead.
Set preferred hour to run monitoring tests (deprecated)
35 36 37 38 |
# File 'lib/qa_server/configuration.rb', line 35 def hour_offset_to_run_monitoring_tests=(offset) Deprecation.warn(QaServer, "hour_offset_to_run_monitoring_tests= is deprecated and will be removed from a future release (use #hour_offset_to_expire_cache= instead)") @hour_offset_to_expire_cache = offset end |
#monitor_logger ⇒ Object
For internal use only
266 267 268 |
# File 'lib/qa_server/configuration.rb', line 266 def monitor_logger @monitor_logger ||= Logger.new(ENV['MONITOR_LOG_PATH'] || File.join("log", "monitor.log")) end |
#navmenu_presenter ⇒ Object
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
189 190 191 192 193 194 |
# File 'lib/qa_server/configuration.rb', line 189 def return @navmenu_presenter if @navmenu_presenter.present? @navmenu_presenter ||= QaServer::NavmenuPresenter.new @navmenu_presenter.() @navmenu_presenter end |
#performance_cache ⇒ Object
For internal use only
236 237 238 |
# File 'lib/qa_server/configuration.rb', line 236 def performance_cache @performance_cache ||= QaServer::PerformanceCache.new end |
#performance_cache_logger ⇒ Object
For internal use only
251 252 253 |
# File 'lib/qa_server/configuration.rb', line 251 def performance_cache_logger @performance_cache_logger ||= Logger.new(ENV['PERFORMANCE_CACHE_LOG_PATH'] || File.join("log", "performance_cache.log")) end |
#performance_datatable_default_time_period ⇒ Symbol
Performance datatable default time period for calculating stats.
160 161 162 |
# File 'lib/qa_server/configuration.rb', line 160 def performance_datatable_default_time_period @performance_datatable_default_time_period ||= :year end |
#performance_datatable_default_time_period=(time_period) ⇒ Object
Performance datatable default time period for calculating stats.
153 154 155 156 |
# File 'lib/qa_server/configuration.rb', line 153 def performance_datatable_default_time_period=(time_period) raise ArgumentError, 'time_period must be one of :day, :month, :year, or :all' unless [:day, :month, :year, :all].include? time_period @performance_datatable_default_time_period = time_period end |
#performance_graph_default_time_period ⇒ Symbol
Performance graph default time period for all graphs. All authorities will show the graph for this time period on page load.
138 139 140 |
# File 'lib/qa_server/configuration.rb', line 138 def performance_graph_default_time_period @performance_graph_default_time_period ||= :month end |
#performance_graph_default_time_period=(time_period) ⇒ Object
Performance graph default time period for all graphs. All authorities will show the graph for this time period on page load.
131 132 133 134 |
# File 'lib/qa_server/configuration.rb', line 131 def performance_graph_default_time_period=(time_period) raise ArgumentError, 'time_period must be one of :day, :month, or :year' unless [:day, :month, :year].include? time_period @performance_graph_default_time_period = time_period end |
#performance_tracker ⇒ Object
196 197 198 199 200 |
# File 'lib/qa_server/configuration.rb', line 196 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 |
#suppress_logging_performance_details? ⇒ Boolean Also known as: suppress_logging_performance_datails, suppress_logging_performance_datails?
217 218 219 220 |
# File 'lib/qa_server/configuration.rb', line 217 def suppress_logging_performance_details? return @suppress_logging_performance_details unless @suppress_logging_performance_details.nil? @suppress_logging_performance_details ||= false end |
#suppress_performance_gathering? ⇒ Boolean Also known as: suppress_performance_gathering
206 207 208 209 |
# File 'lib/qa_server/configuration.rb', line 206 def suppress_performance_gathering? return @suppress_performance_gathering unless @suppress_performance_gathering.nil? @suppress_performance_gathering ||= false end |