Module: QaServer::MonitorStatus::PerformanceGraphBehavior

Includes:
GruffGraph, PerformanceHistoryDataKeys
Included in:
PerformancePresenter
Defined in:
app/presenters/concerns/qa_server/monitor_status/performance_graph_behavior.rb

Overview

rubocop:disable Metrics/ModuleLength

Constant Summary

Constants included from PerformanceHistoryDataKeys

PerformanceHistoryDataKeys::ALL_ACTIONS, PerformanceHistoryDataKeys::ALL_AUTH, PerformanceHistoryDataKeys::AVG_ACTN, PerformanceHistoryDataKeys::AVG_FULL, PerformanceHistoryDataKeys::AVG_GRPH, PerformanceHistoryDataKeys::AVG_LOAD, PerformanceHistoryDataKeys::AVG_NORM, PerformanceHistoryDataKeys::AVG_RETR, PerformanceHistoryDataKeys::BY_DAY, PerformanceHistoryDataKeys::BY_HOUR, PerformanceHistoryDataKeys::BY_MONTH, PerformanceHistoryDataKeys::FETCH, PerformanceHistoryDataKeys::FOR_DATATABLE, PerformanceHistoryDataKeys::FOR_DAY, PerformanceHistoryDataKeys::FOR_MONTH, PerformanceHistoryDataKeys::FOR_YEAR, PerformanceHistoryDataKeys::HIGH_ACTN, PerformanceHistoryDataKeys::HIGH_FULL, PerformanceHistoryDataKeys::HIGH_GRPH, PerformanceHistoryDataKeys::HIGH_LOAD, PerformanceHistoryDataKeys::HIGH_NORM, PerformanceHistoryDataKeys::HIGH_RETR, PerformanceHistoryDataKeys::LOW_ACTN, PerformanceHistoryDataKeys::LOW_FULL, PerformanceHistoryDataKeys::LOW_GRPH, PerformanceHistoryDataKeys::LOW_LOAD, PerformanceHistoryDataKeys::LOW_NORM, PerformanceHistoryDataKeys::LOW_RETR, PerformanceHistoryDataKeys::SEARCH, PerformanceHistoryDataKeys::STATS

Instance Method Summary collapse

Instance Method Details

#performance_all_actions_graph?(graph_info) ⇒ Boolean

Returns:

  • (Boolean)


72
73
74
75
# File 'app/presenters/concerns/qa_server/monitor_status/performance_graph_behavior.rb', line 72

def performance_all_actions_graph?(graph_info)
  return true if performance_graph_action(graph_info) == :all_actions
  false
end

#performance_data_section_class(graph_info) ⇒ Object



52
53
54
55
# File 'app/presenters/concerns/qa_server/monitor_status/performance_graph_behavior.rb', line 52

def performance_data_section_class(graph_info)
  return 'performance-data-section-visible' if default_graph?(graph_info)
  'performance-data-section-hidden'
end

#performance_day_graph?(graph_info) ⇒ Boolean

Returns:

  • (Boolean)


57
58
59
60
# File 'app/presenters/concerns/qa_server/monitor_status/performance_graph_behavior.rb', line 57

def performance_day_graph?(graph_info)
  return true if performance_graph_time_period(graph_info) == :day
  false
end

#performance_default_graph_idObject



28
29
30
# File 'app/presenters/concerns/qa_server/monitor_status/performance_graph_behavior.rb', line 28

def performance_default_graph_id
  "performance-for-day-#{ALL_AUTH}"
end

#performance_fetch_graph?(graph_info) ⇒ Boolean

Returns:

  • (Boolean)


82
83
84
85
# File 'app/presenters/concerns/qa_server/monitor_status/performance_graph_behavior.rb', line 82

def performance_fetch_graph?(graph_info)
  return true if performance_graph_action(graph_info) == :fetch
  false
end

#performance_graph(graph_info) ⇒ Object



16
17
18
# File 'app/presenters/concerns/qa_server/monitor_status/performance_graph_behavior.rb', line 16

def performance_graph(graph_info)
  graph_info[:graph]
end

#performance_graph_action(graph_info) ⇒ Object



36
37
38
# File 'app/presenters/concerns/qa_server/monitor_status/performance_graph_behavior.rb', line 36

def performance_graph_action(graph_info)
  graph_info[:action]
end

#performance_graph_authority(graph_info) ⇒ Object



20
21
22
# File 'app/presenters/concerns/qa_server/monitor_status/performance_graph_behavior.rb', line 20

def performance_graph_authority(graph_info)
  graph_info[:authority_name]
end

#performance_graph_data_section_base_id(graph_info) ⇒ Object



48
49
50
# File 'app/presenters/concerns/qa_server/monitor_status/performance_graph_behavior.rb', line 48

def performance_graph_data_section_base_id(graph_info)
  graph_info[:base_id]
end

#performance_graph_data_section_id(graph_info) ⇒ Object



44
45
46
# File 'app/presenters/concerns/qa_server/monitor_status/performance_graph_behavior.rb', line 44

def performance_graph_data_section_id(graph_info)
  "#{graph_info[:base_id]}-#{performance_graph_action(graph_info)}-during-#{performance_graph_time_period(graph_info)}"
end

#performance_graph_id(graph_info) ⇒ Object



40
41
42
# File 'app/presenters/concerns/qa_server/monitor_status/performance_graph_behavior.rb', line 40

def performance_graph_id(graph_info)
  "#{graph_info[:base_id]}-#{performance_graph_action(graph_info)}-during-#{performance_graph_time_period(graph_info)}-chart"
end

#performance_graph_label(graph_info) ⇒ Object



24
25
26
# File 'app/presenters/concerns/qa_server/monitor_status/performance_graph_behavior.rb', line 24

def performance_graph_label(graph_info)
  graph_info[:label]
end

#performance_graph_time_period(graph_info) ⇒ Object



32
33
34
# File 'app/presenters/concerns/qa_server/monitor_status/performance_graph_behavior.rb', line 32

def performance_graph_time_period(graph_info)
  graph_info[:time_period]
end

#performance_graphsObject



8
9
10
11
12
13
14
# File 'app/presenters/concerns/qa_server/monitor_status/performance_graph_behavior.rb', line 8

def performance_graphs
  auth_list = QaServer::AuthorityListerService.authorities_list
  graphs = []
  performance_graphs_for_authority(graphs, ALL_AUTH)
  auth_list.each { |auth_name| performance_graphs_for_authority(graphs, auth_name) }
  graphs
end

#performance_month_graph?(graph_info) ⇒ Boolean

Returns:

  • (Boolean)


62
63
64
65
# File 'app/presenters/concerns/qa_server/monitor_status/performance_graph_behavior.rb', line 62

def performance_month_graph?(graph_info)
  return true if performance_graph_time_period(graph_info) == :month
  false
end

#performance_search_graph?(graph_info) ⇒ Boolean

Returns:

  • (Boolean)


77
78
79
80
# File 'app/presenters/concerns/qa_server/monitor_status/performance_graph_behavior.rb', line 77

def performance_search_graph?(graph_info)
  return true if performance_graph_action(graph_info) == :search
  false
end

#performance_year_graph?(graph_info) ⇒ Boolean

Returns:

  • (Boolean)


67
68
69
70
# File 'app/presenters/concerns/qa_server/monitor_status/performance_graph_behavior.rb', line 67

def performance_year_graph?(graph_info)
  return true if performance_graph_time_period(graph_info) == :year
  false
end