Module: QaServer::MonitorStatus::PerformanceGraphBehavior

Includes:
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::BPMS_GRPH, PerformanceHistoryDataKeys::BPMS_NORM, PerformanceHistoryDataKeys::BPMS_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::MSPB_GRPH, PerformanceHistoryDataKeys::MSPB_NORM, PerformanceHistoryDataKeys::MSPB_RETR, PerformanceHistoryDataKeys::SEARCH, PerformanceHistoryDataKeys::SRC_BYTES, PerformanceHistoryDataKeys::STATS

Instance Method Summary collapse

Instance Method Details

#performance_all_actions_graph?(graph_info) ⇒ Boolean

Returns:

  • (Boolean)


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

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



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

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)


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

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

#performance_default_graph_idObject



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

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

#performance_fetch_graph?(graph_info) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#performance_graph(graph_info) ⇒ Object



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

def performance_graph(graph_info)
  graph_info[:graph]
end

#performance_graph_action(graph_info) ⇒ Object



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

def performance_graph_action(graph_info)
  graph_info[:action]
end

#performance_graph_authority(graph_info) ⇒ Object



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

def performance_graph_authority(graph_info)
  graph_info[:authority_name]
end

#performance_graph_data_section_base_id(graph_info) ⇒ Object



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

def performance_graph_data_section_base_id(graph_info)
  graph_info[:base_id]
end

#performance_graph_data_section_id(graph_info) ⇒ Object



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

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



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

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



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

def performance_graph_label(graph_info)
  graph_info[:label]
end

#performance_graph_time_period(graph_info) ⇒ Object



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

def performance_graph_time_period(graph_info)
  graph_info[:time_period]
end

#performance_graphsObject



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

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)


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

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)


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

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)


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

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