Module: QaServer::MonitorStatus::PerformanceDatatableBehavior

Includes:
PerformanceHistoryDataKeys
Included in:
PerformancePresenter
Defined in:
app/presenters/concerns/qa_server/monitor_status/performance_datatable_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

#avg_full_request(stats) ⇒ Object



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

def avg_full_request(stats)
  format_stat stats, AVG_ACTN
end

#avg_full_request_style(stats) ⇒ Object



80
81
82
# File 'app/presenters/concerns/qa_server/monitor_status/performance_datatable_behavior.rb', line 80

def avg_full_request_style(stats)
  performance_style_class(stats, AVG_ACTN)
end

#avg_graph_load(stats) ⇒ Object



55
56
57
# File 'app/presenters/concerns/qa_server/monitor_status/performance_datatable_behavior.rb', line 55

def avg_graph_load(stats)
  format_stat stats, AVG_GRPH
end

#avg_normalization(stats) ⇒ Object



59
60
61
# File 'app/presenters/concerns/qa_server/monitor_status/performance_datatable_behavior.rb', line 59

def avg_normalization(stats)
  format_stat stats, AVG_NORM
end

#avg_retrieve(stats) ⇒ Object



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

def avg_retrieve(stats)
  format_stat stats, AVG_RETR
end

#datatable_all_actions_stats(authority_data) ⇒ Object



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

def datatable_all_actions_stats(authority_data)
  data_table_for(authority_data, ALL_ACTIONS)
end

#datatable_data_style(stats) ⇒ Object



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

def datatable_data_style(stats)
  return "status-not-supported" if unsupported_action?(stats)
  "status-neutral"
end

#datatable_fetch_stats(authority_data) ⇒ Object



11
12
13
# File 'app/presenters/concerns/qa_server/monitor_status/performance_datatable_behavior.rb', line 11

def datatable_fetch_stats(authority_data)
  data_table_for(authority_data, FETCH)
end

#datatable_search_stats(authority_data) ⇒ Object



7
8
9
# File 'app/presenters/concerns/qa_server/monitor_status/performance_datatable_behavior.rb', line 7

def datatable_search_stats(authority_data)
  data_table_for(authority_data, SEARCH)
end

#high_full_request(stats) ⇒ Object



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

def high_full_request(stats)
  format_stat stats, HIGH_ACTN
end

#high_full_request_style(stats) ⇒ Object



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

def high_full_request_style(stats)
  performance_style_class(stats, HIGH_ACTN)
end

#high_graph_load(stats) ⇒ Object



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

def high_graph_load(stats)
  format_stat stats, HIGH_GRPH
end

#high_normalization(stats) ⇒ Object



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

def high_normalization(stats)
  format_stat stats, HIGH_NORM
end

#high_retrieve(stats) ⇒ Object



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

def high_retrieve(stats)
  format_stat stats, HIGH_RETR
end

#low_full_request(stats) ⇒ Object



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

def low_full_request(stats)
  format_stat stats, LOW_ACTN
end

#low_full_request_style(stats) ⇒ Object



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

def low_full_request_style(stats)
  performance_style_class(stats, LOW_ACTN)
end

#low_graph_load(stats) ⇒ Object



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

def low_graph_load(stats)
  format_stat stats, LOW_GRPH
end

#low_normalization(stats) ⇒ Object



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

def low_normalization(stats)
  format_stat stats, LOW_NORM
end

#low_retrieve(stats) ⇒ Object



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

def low_retrieve(stats)
  format_stat stats, LOW_RETR
end

#performance_data_endObject



115
116
117
# File 'app/presenters/concerns/qa_server/monitor_status/performance_datatable_behavior.rb', line 115

def performance_data_end
  QaServer::TimeService.pretty_date(performance_data_end_dt)
end

#performance_data_end_dtObject



111
112
113
# File 'app/presenters/concerns/qa_server/monitor_status/performance_datatable_behavior.rb', line 111

def performance_data_end_dt
  @parent.last_updated_dt
end

#performance_data_startObject



97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'app/presenters/concerns/qa_server/monitor_status/performance_datatable_behavior.rb', line 97

def performance_data_start
  start_dt = case expected_time_period
             when :day
               performance_data_end_dt - 1.day
             when :month
               performance_data_end_dt - 1.month
             when :year
               performance_data_end_dt - 1.year
             else
               @parent.first_updated_dt
             end
  QaServer::TimeService.pretty_date(start_dt)
end

#performance_table_descriptionObject



84
85
86
87
88
89
90
91
92
93
94
95
# File 'app/presenters/concerns/qa_server/monitor_status/performance_datatable_behavior.rb', line 84

def performance_table_description
  case expected_time_period
  when :day
    I18n.t('qa_server.monitor_status.performance.datatable_day_desc')
  when :month
    I18n.t('qa_server.monitor_status.performance.datatable_month_desc')
  when :year
    I18n.t('qa_server.monitor_status.performance.datatable_year_desc')
  else
    I18n.t('qa_server.monitor_status.performance.datatable_all_desc')
  end
end