qa_server 2.2.1 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/app/assets/stylesheets/qa_server/_monitor-status.scss +8 -0
  4. data/app/controllers/qa_server/check_status_controller.rb +1 -1
  5. data/app/controllers/qa_server/monitor_status_controller.rb +71 -13
  6. data/app/models/concerns/qa_server/performance_history_data_keys.rb +29 -0
  7. data/app/models/qa_server/performance_history.rb +75 -179
  8. data/app/prepends/prepended_linked_data/find_term.rb +1 -1
  9. data/app/prepends/prepended_linked_data/search_query.rb +1 -1
  10. data/app/presenters/concerns/qa_server/monitor_status/gruff_graph.rb +0 -1
  11. data/app/presenters/concerns/qa_server/monitor_status/performance_datatable_behavior.rb +101 -0
  12. data/app/presenters/concerns/qa_server/monitor_status/performance_graph_behavior.rb +109 -0
  13. data/app/presenters/qa_server/monitor_status/performance_presenter.rb +4 -220
  14. data/app/presenters/qa_server/monitor_status_presenter.rb +8 -5
  15. data/app/services/qa_server/performance_calculator_service.rb +103 -0
  16. data/app/services/qa_server/performance_graph_data_service.rb +113 -0
  17. data/app/services/qa_server/performance_graphing_service.rb +113 -0
  18. data/app/views/qa_server/monitor_status/_performance.html.erb +90 -0
  19. data/app/views/qa_server/monitor_status/_test_history.html.erb +32 -0
  20. data/app/views/qa_server/monitor_status/_test_summary.html.erb +54 -0
  21. data/app/views/qa_server/monitor_status/index.html.erb +3 -182
  22. data/config/locales/qa_server.en.yml +11 -7
  23. data/lib/generators/qa_server/templates/config/initializers/qa_server.rb +26 -0
  24. data/lib/qa_server/configuration.rb +42 -0
  25. data/lib/qa_server/version.rb +1 -1
  26. metadata +11 -2
@@ -0,0 +1,113 @@
1
+ # frozen_string_literal: true
2
+ # This class sets creates the performance graphs for each authority during day, month, and year time periods for fetch and search actions.
3
+ module QaServer
4
+ class PerformanceGraphingService
5
+ class << self
6
+ include QaServer::PerformanceHistoryDataKeys
7
+ include QaServer::MonitorStatus::GruffGraph
8
+
9
+ class_attribute :authority_list_class
10
+ self.authority_list_class = QaServer::AuthorityListerService
11
+
12
+ # @param performance_data [Hash] hash of all performance data for all authorities
13
+ # @see QaServer:PerformanceHistory
14
+ def create_performance_graphs(performance_data:)
15
+ performance_data.each_key { |auth_name| create_graphs_for_authority(performance_data, auth_name.to_sym) }
16
+ end
17
+
18
+ # @param authority_name [String] name of the authority
19
+ # @param time_period [Symbol] time period for the graph (i.e. :day, :month, :year)
20
+ def performance_graph_file(authority_name: ALL_AUTH, time_period:)
21
+ File.join(graph_relative_path, graph_filename(authority_name, time_period))
22
+ end
23
+
24
+ private
25
+
26
+ def create_graphs_for_authority(performance_data, authority_name)
27
+ create_performance_for_day_graph(performance_data, authority_name)
28
+ create_performance_for_month_graph(performance_data, authority_name)
29
+ create_performance_for_year_graph(performance_data, authority_name)
30
+ end
31
+
32
+ def create_performance_for_day_graph(performance_data, authority_name)
33
+ auth_data = authority_performance_data(performance_data, authority_name)
34
+ return unless auth_data
35
+ gruff_data = rework_performance_data_for_gruff(auth_data[FOR_DAY], BY_HOUR)
36
+ create_gruff_graph(gruff_data,
37
+ performance_for_day_graph_full_path(authority_name),
38
+ I18n.t('qa_server.monitor_status.performance.x_axis_hour'))
39
+ end
40
+
41
+ def create_performance_for_month_graph(performance_data, authority_name)
42
+ auth_data = authority_performance_data(performance_data, authority_name)
43
+ gruff_data = rework_performance_data_for_gruff(auth_data[FOR_MONTH], BY_DAY)
44
+ create_gruff_graph(gruff_data,
45
+ performance_for_month_graph_full_path(authority_name),
46
+ I18n.t('qa_server.monitor_status.performance.x_axis_day'))
47
+ end
48
+
49
+ def create_performance_for_year_graph(performance_data, authority_name)
50
+ auth_data = authority_performance_data(performance_data, authority_name)
51
+ gruff_data = rework_performance_data_for_gruff(auth_data[FOR_YEAR], BY_MONTH)
52
+ create_gruff_graph(gruff_data,
53
+ performance_for_year_graph_full_path(authority_name),
54
+ I18n.t('qa_server.monitor_status.performance.x_axis_month'))
55
+ end
56
+
57
+ def authority_performance_data(data, authority_name)
58
+ auth_name = authority_name.nil? ? ALL_AUTH : authority_name
59
+ data[auth_name]
60
+ end
61
+
62
+ def performance_graph_theme(g, x_axis_label)
63
+ g.theme_pastel
64
+ g.colors = [QaServer.config.performance_normalization_color,
65
+ QaServer.config.performance_load_color]
66
+ g.marker_font_size = 12
67
+ g.x_axis_increment = 10
68
+ g.x_axis_label = x_axis_label
69
+ g.y_axis_label = I18n.t('qa_server.monitor_status.performance.y_axis_ms')
70
+ g.minimum_value = 0
71
+ g.maximum_value = 2000
72
+ end
73
+
74
+ def performance_for_day_graph_full_path(authority_name)
75
+ graph_full_path(graph_filename(authority_name, :day))
76
+ end
77
+
78
+ def performance_for_month_graph_full_path(authority_name)
79
+ graph_full_path(graph_filename(authority_name, :month))
80
+ end
81
+
82
+ def performance_for_year_graph_full_path(authority_name)
83
+ graph_full_path(graph_filename(authority_name, :year))
84
+ end
85
+
86
+ def graph_filename(authority_name, time_period)
87
+ "performance_of_#{authority_name}_for_#{time_period}_graph.png"
88
+ end
89
+
90
+ def rework_performance_data_for_gruff(performance_data, label_key)
91
+ labels = {}
92
+ load_data = []
93
+ normalization_data = []
94
+ performance_data.each do |i, data|
95
+ labels[i] = data[label_key]
96
+ load_data << data[STATS][AVG_LOAD]
97
+ normalization_data << data[STATS][AVG_NORM]
98
+ end
99
+ [labels, normalization_data, load_data]
100
+ end
101
+
102
+ def create_gruff_graph(performance_data, performance_graph_full_path, x_axis_label)
103
+ g = Gruff::StackedBar.new
104
+ performance_graph_theme(g, x_axis_label)
105
+ g.title = ''
106
+ g.labels = performance_data[0]
107
+ g.data(I18n.t('qa_server.monitor_status.performance.normalization_time_ms'), performance_data[1])
108
+ g.data(I18n.t('qa_server.monitor_status.performance.load_time_ms'), performance_data[2])
109
+ g.write performance_graph_full_path
110
+ end
111
+ end
112
+ end
113
+ end
@@ -0,0 +1,90 @@
1
+ <% if @presenter.display_performance? && @presenter.performance_data? %>
2
+ <div id="performance-data" class="status-section">
3
+ <h3><%= t('qa_server.monitor_status.performance.title') %></h3>
4
+
5
+ <% if @presenter.display_performance_graph? %>
6
+ <script>
7
+ function switch_performance_view(base_id, time_period) {
8
+ document.getElementById(base_id+'-during-day').className = 'performance-data-section-hidden';
9
+ document.getElementById(base_id+'-during-month').className = 'performance-data-section-hidden';
10
+ document.getElementById(base_id+'-during-year').className = 'performance-data-section-hidden';
11
+ document.getElementById(base_id+'-during-'+time_period).className = 'performance-data-section-visible';
12
+ }
13
+ </script>
14
+
15
+ <% @presenter.performance_graphs.each do |graph_info| %>
16
+ <div id="<%= @presenter.performance_graph_data_section_id(graph_info) %>" class="<%= @presenter.performance_data_section_class(graph_info) %>">
17
+ <div class="right-menu-section">
18
+ <h4><%= @presenter.performance_graph_authority(graph_info) %></h4>
19
+ <ul class="right-menu">
20
+ <% if @presenter.performance_day_graph_selected?(graph_info) %>
21
+ <li class="selected"><%= t('qa_server.monitor_status.performance.menu_day') %></li>
22
+ <% else %>
23
+ <li class="clickable" onClick="switch_performance_view('<%= @presenter.performance_graph_data_section_base_id(graph_info) %>', 'day')">
24
+ <%= t('qa_server.monitor_status.performance.menu_day') %>
25
+ </li>
26
+ <% end %>
27
+ <% if @presenter.performance_month_graph_selected?(graph_info) %>
28
+ <li class="selected"><%= t('qa_server.monitor_status.performance.menu_month') %></li>
29
+ <% else %>
30
+ <li class="clickable" onClick="switch_performance_view('<%= @presenter.performance_graph_data_section_base_id(graph_info) %>', 'month')">
31
+ <%= t('qa_server.monitor_status.performance.menu_month') %>
32
+ </li>
33
+ <% end %>
34
+ <% if @presenter.performance_year_graph_selected?(graph_info) %>
35
+ <li class="selected"><%= t('qa_server.monitor_status.performance.menu_year') %></li>
36
+ <% else %>
37
+ <li class="clickable" onClick="switch_performance_view('<%= @presenter.performance_graph_data_section_base_id(graph_info) %>', 'year')">
38
+ <%= t('qa_server.monitor_status.performance.menu_year') %>
39
+ </li>
40
+ <% end %>
41
+ </ul>
42
+ </div>
43
+
44
+ <div id="<%= @presenter.performance_graph_id(graph_info) %>" class="performance-chart">
45
+ <p><%= @presenter.performance_graph_label(graph_info) %></p>
46
+ <%= image_tag(@presenter.performance_graph(graph_info), alt: @presenter.performance_graph_label(graph_info)) %>
47
+ </div>
48
+ </div>
49
+ <% end %>
50
+ </div>
51
+ <% end %>
52
+
53
+ <% if @presenter.display_performance_datatable? %>
54
+ <div id="performance-datatable-section">
55
+ <h4><%= @presenter.performance_table_description %></h4>
56
+ <table class="status">
57
+ <tr>
58
+ <th></th>
59
+ <th><%= t('qa_server.monitor_status.performance.slowest_times') %></th>
60
+ <th><%= t('qa_server.monitor_status.performance.average_times') %></th>
61
+ <th><%= t('qa_server.monitor_status.performance.fastest_times') %></th>
62
+ </tr>
63
+ <% @presenter.performance_data.each do |authority_name, data| %>
64
+ <% stats = @presenter.datatable_stats(data) %>
65
+ <tr>
66
+ <td class="table_subheading" colspan="4"><%= authority_name %></td>
67
+ </tr>
68
+ <tr>
69
+ <th><%= t('qa_server.monitor_status.performance.load_times') %></th>
70
+ <td class="status-neutral"><%= @presenter.high_load(stats) %></td>
71
+ <td class="status-neutral"><%= @presenter.avg_load(stats) %></td>
72
+ <td class="status-neutral"><%= @presenter.low_load(stats) %></td>
73
+ </tr>
74
+ <tr>
75
+ <th><%= t('qa_server.monitor_status.performance.normalization_times') %></th>
76
+ <td class="status-neutral"><%= @presenter.high_normalization(stats) %></td>
77
+ <td class="status-neutral"><%= @presenter.avg_normalization(stats) %></td>
78
+ <td class="status-neutral"><%= @presenter.low_normalization(stats) %></td>
79
+ </tr>
80
+ <tr>
81
+ <th><%= t('qa_server.monitor_status.performance.full_request_times') %></th>
82
+ <td class="<%= @presenter.high_full_request_style(stats) %>"><%= @presenter.high_full_request(stats) %></td>
83
+ <td class="<%= @presenter.avg_full_request_style(stats) %>"><%= @presenter.avg_full_request(stats) %></td>
84
+ <td class="<%= @presenter.low_full_request_style(stats) %>"><%= @presenter.low_full_request(stats) %></td>
85
+ </tr>
86
+ <% end %>
87
+ </table>
88
+ </div>
89
+ <% end %>
90
+ <% end %>
@@ -0,0 +1,32 @@
1
+ <% if @presenter.history? && @presenter.display_history_details?%>
2
+ <div id="availability-history" class="status-section">
3
+ <h3><%= t('qa_server.monitor_status.history.title') %></h3>
4
+ <p class="status-update-dtstamp"><%= t('qa_server.monitor_status.history.since', date: @presenter.first_updated) %></p>
5
+ <%#= column_chart @presenter.historical_summary, stacked: true, colors: ["green", "red"], xtitle: 'Authority', ytitle: 'Pass-Fail', legend: 'bottom' %>
6
+ <% if @presenter.display_historical_graph? %>
7
+ <%= image_tag(@presenter.historical_graph, alt: 'History Graph Unavailable') %>
8
+ <% end %>
9
+
10
+ <% if @presenter.display_historical_datatable? %>
11
+ <table class="status">
12
+ <tr>
13
+ <th><%= t('qa_server.monitor_status.history.authority') %></th>
14
+ <th><%= t('qa_server.monitor_status.history.days_tested') %></th>
15
+ <th><%= t('qa_server.monitor_status.history.days_passing') %></th>
16
+ <th><%= t('qa_server.monitor_status.history.days_failing') %></th>
17
+ <th><%= t('qa_server.monitor_status.history.percent_failing') %></th>
18
+ </tr>
19
+ <% @presenter.historical_summary.each do |entry| %>
20
+ <tr>
21
+ <td><%= @presenter.historical_data_authority_name(entry) %></td>
22
+ <td class="status-neutral"><%= @presenter.days_authority_tested(entry) %></td>
23
+ <td class="<%= @presenter.passing_style_class(entry) %>"><%= @presenter.days_authority_passing(entry) %></td>
24
+ <td class="<%= @presenter.failure_style_class(entry) %>"><%= @presenter.days_authority_failing(entry) %></td>
25
+ <td class="<%= @presenter.failure_style_class(entry) %>"><%= @presenter.percent_authority_failing_str(entry) %></td>
26
+ </tr>
27
+ <% end %>
28
+ </table>
29
+ <% end %>
30
+ </div>
31
+ <% end %>
32
+
@@ -0,0 +1,54 @@
1
+ <h3><%= t('qa_server.monitor_status.summary.title') %></h3>
2
+
3
+ <h4><%= t('qa_server.monitor_status.summary.summary_table') %></h4>
4
+ <table class="monitor-status-status">
5
+ <tr>
6
+ <th><%= t('qa_server.monitor_status.summary.authorities') %></th>
7
+ <th><%= t('qa_server.monitor_status.summary.authorities_with_failures') %></th>
8
+ <th><%= t('qa_server.monitor_status.summary.passing_tests') %></th>
9
+ <th><%= t('qa_server.monitor_status.summary.failing_tests') %></th>
10
+ <th><%= t('qa_server.monitor_status.summary.total_tests') %></th>
11
+ </tr>
12
+ <tr>
13
+ <td class="status-neutral"><%= @presenter.authorities_count %></td>
14
+ <td class="<%= @presenter.authorities_count_style %>"><%= @presenter.failing_authorities_count %></td>
15
+ <td class="status-neutral"><%= @presenter.passing_tests_count%></td>
16
+ <td class="<%= @presenter.failing_tests_style %>"><%= @presenter.failing_tests_count %></td>
17
+ <td class="status-neutral"><%= @presenter.tests_count %></td>
18
+ </tr>
19
+ </table>
20
+ <p class="status-update-dtstamp"><%= t('qa_server.monitor_status.summary.last_updated', date: @presenter.last_updated) %></p>
21
+
22
+ <% if @presenter.failures? %>
23
+ <div id="failures" class="status-section">
24
+ <h4><%= t('qa_server.monitor_status.failures.title') %></h4>
25
+
26
+ <table class="status">
27
+ <tr>
28
+ <th><%= t('qa_server.monitor_status.failures.status') %></th>
29
+ <th><%= t('qa_server.monitor_status.failures.subauthority') %></th>
30
+ <th><%= t('qa_server.monitor_status.failures.service') %></th>
31
+ <th><%= t('qa_server.monitor_status.failures.action') %></th>
32
+ <th><%= t('qa_server.monitor_status.failures.url') %></th>
33
+ <th><%= t('qa_server.monitor_status.failures.errmsg') %></th>
34
+ </tr>
35
+ <% current_authority = nil %>
36
+ <% @status_data.each do |status| %>
37
+ <% unless status[:authority_name] == current_authority %>
38
+ <% current_authority = status[:authority_name] %>
39
+ <tr>
40
+ <td class="table_subheading" colspan="6"><%= current_authority %></td>
41
+ </tr>
42
+ <% end %>
43
+ <tr>
44
+ <td class="<%= @presenter.status_style_class(status) %>"><%= @presenter.status_label(status) %></td>
45
+ <td><%= status[:subauthority_name] %></td>
46
+ <td><%= status[:service] %></td>
47
+ <td><%= status[:action] %></td>
48
+ <td><a href="<%= status[:url] %>"><%= status[:url] %></a></td>
49
+ <td><%= status[:err_message] %></td>
50
+ </tr>
51
+ <% end %>
52
+ </table>
53
+ </div>
54
+ <% end %>
@@ -4,187 +4,8 @@
4
4
 
5
5
  <h2><%= t('qa_server.monitor_status.title') %></h2>
6
6
 
7
- <h3><%= t('qa_server.monitor_status.summary.title') %></h3>
7
+ <%= render 'test_summary' %>
8
+ <%= render 'test_history' %>
9
+ <%= render 'performance' %>
8
10
 
9
- <h4><%= t('qa_server.monitor_status.summary.summary_table') %></h4>
10
- <table class="monitor-status-status">
11
- <tr>
12
- <th><%= t('qa_server.monitor_status.summary.authorities') %></th>
13
- <th><%= t('qa_server.monitor_status.summary.authorities_with_failures') %></th>
14
- <th><%= t('qa_server.monitor_status.summary.passing_tests') %></th>
15
- <th><%= t('qa_server.monitor_status.summary.failing_tests') %></th>
16
- <th><%= t('qa_server.monitor_status.summary.total_tests') %></th>
17
- </tr>
18
- <tr>
19
- <td class="status-neutral"><%= @presenter.authorities_count %></td>
20
- <td class="<%= @presenter.authorities_count_style %>"><%= @presenter.failing_authorities_count %></td>
21
- <td class="status-neutral"><%= @presenter.passing_tests_count%></td>
22
- <td class="<%= @presenter.failing_tests_style %>"><%= @presenter.failing_tests_count %></td>
23
- <td class="status-neutral"><%= @presenter.tests_count %></td>
24
- </tr>
25
- </table>
26
- <p class="status-update-dtstamp"><%= t('qa_server.monitor_status.summary.last_updated', date: @presenter.last_updated) %></p>
27
-
28
- <% if @presenter.failures? %>
29
- <div id="failures" class="status-section">
30
- <h4><%= t('qa_server.monitor_status.failures.title') %></h4>
31
-
32
- <table class="status">
33
- <tr>
34
- <th><%= t('qa_server.monitor_status.failures.status') %></th>
35
- <th><%= t('qa_server.monitor_status.failures.subauthority') %></th>
36
- <th><%= t('qa_server.monitor_status.failures.service') %></th>
37
- <th><%= t('qa_server.monitor_status.failures.action') %></th>
38
- <th><%= t('qa_server.monitor_status.failures.url') %></th>
39
- <th><%= t('qa_server.monitor_status.failures.errmsg') %></th>
40
- </tr>
41
- <% current_authority = nil %>
42
- <% @status_data.each do |status| %>
43
- <% unless status[:authority_name] == current_authority %>
44
- <% current_authority = status[:authority_name] %>
45
- <tr>
46
- <td class="table_subheading" colspan="6"><%= current_authority %></td>
47
- </tr>
48
- <% end %>
49
- <tr>
50
- <td class="<%= @presenter.status_style_class(status) %>"><%= @presenter.status_label(status) %></td>
51
- <td><%= status[:subauthority_name] %></td>
52
- <td><%= status[:service] %></td>
53
- <td><%= status[:action] %></td>
54
- <td><a href="<%= status[:url] %>"><%= status[:url] %></a></td>
55
- <td><%= status[:err_message] %></td>
56
- </tr>
57
- <% end %>
58
- </table>
59
- </div>
60
- <% end %>
61
-
62
- <% if @presenter.history? && @presenter.display_history_details?%>
63
- <div id="availability-history" class="status-section">
64
- <h3><%= t('qa_server.monitor_status.history.title') %></h3>
65
- <p class="status-update-dtstamp"><%= t('qa_server.monitor_status.history.since', date: @presenter.first_updated) %></p>
66
- <%#= column_chart @presenter.historical_summary, stacked: true, colors: ["green", "red"], xtitle: 'Authority', ytitle: 'Pass-Fail', legend: 'bottom' %>
67
- <% if @presenter.display_historical_graph? %>
68
- <%= image_tag(@presenter.historical_graph, alt: 'History Graph Unavailable') %>
69
- <% end %>
70
-
71
- <% if @presenter.display_historical_datatable? %>
72
- <table class="status">
73
- <tr>
74
- <th><%= t('qa_server.monitor_status.history.authority') %></th>
75
- <th><%= t('qa_server.monitor_status.history.days_tested') %></th>
76
- <th><%= t('qa_server.monitor_status.history.days_passing') %></th>
77
- <th><%= t('qa_server.monitor_status.history.days_failing') %></th>
78
- <th><%= t('qa_server.monitor_status.history.percent_failing') %></th>
79
- </tr>
80
- <% @presenter.historical_summary.each do |entry| %>
81
- <tr>
82
- <td><%= @presenter.historical_data_authority_name(entry) %></td>
83
- <td class="status-neutral"><%= @presenter.days_authority_tested(entry) %></td>
84
- <td class="<%= @presenter.passing_style_class(entry) %>"><%= @presenter.days_authority_passing(entry) %></td>
85
- <td class="<%= @presenter.failure_style_class(entry) %>"><%= @presenter.days_authority_failing(entry) %></td>
86
- <td class="<%= @presenter.failure_style_class(entry) %>"><%= @presenter.percent_authority_failing_str(entry) %></td>
87
- </tr>
88
- <% end %>
89
- </table>
90
- <% end %>
91
- </div>
92
- <% end %>
93
-
94
- <% if @presenter.display_performance? && @presenter.performance_data? %>
95
- <div id="performance-data" class="status-section">
96
- <h3><%= t('qa_server.monitor_status.performance.title') %></h3>
97
-
98
- <% if @presenter.display_performance_graph? %>
99
- <script>
100
- function switch_performance_view(id) {
101
- document.getElementById('performance-by-the-hour').style.display = 'none';
102
- document.getElementById('performance-by-the-day').style.display = 'none';
103
- document.getElementById('performance-by-the-month').style.display = 'none';
104
- document.getElementById(id).style.display = 'block';
105
- }
106
- </script>
107
-
108
- <div id="performance-by-the-hour" class="performance-data-section">
109
- <div id="right-menu-section">
110
- <ul class="right-menu">
111
- <li class="selected"><%= t('qa_server.monitor_status.performance.menu_day') %></li>
112
- <li class="clickable" onClick="switch_performance_view('performance-by-the-day')"><%= t('qa_server.monitor_status.performance.menu_month') %></li>
113
- <li class="clickable" onClick="switch_performance_view('performance-by-the-month')"><%= t('qa_server.monitor_status.performance.menu_year') %></li>
114
- </ul>
115
- </div>
116
-
117
- <div id="performance-chart-by-the-hour" class="performance-chart">
118
- <p>Data for the last 24 hours</p>
119
- <%= image_tag(@presenter.performance_for_day_graph, alt: 'Performance data for the last 24 hours.') %>
120
- </div>
121
- </div>
122
-
123
- <div id="performance-by-the-day" class="performance-data-section">
124
- <div id="right-menu-section">
125
- <ul class="right-menu">
126
- <li class="clickable" onClick="switch_performance_view('performance-by-the-hour')"><%= t('qa_server.monitor_status.performance.menu_day') %></li>
127
- <li class="selected"><%= t('qa_server.monitor_status.performance.menu_month') %></li>
128
- <li class="clickable" onClick="switch_performance_view('performance-by-the-month')"><%= t('qa_server.monitor_status.performance.menu_year') %></li>
129
- </ul>
130
- </div>
131
-
132
- <div id="performance-chart-by-the-day" class="performance-chart">
133
- <p>Data for the last 30 days</p>
134
- <%= image_tag(@presenter.performance_for_month_graph, alt: 'Performance data for the last 30 days.') %>
135
- </div>
136
- </div>
137
-
138
- <div id="performance-by-the-month" class="performance-data-section">
139
- <div id="right-menu-section">
140
- <ul class="right-menu">
141
- <li class="clickable" onClick="switch_performance_view('performance-by-the-hour')"><%= t('qa_server.monitor_status.performance.menu_day') %></li>
142
- <li class="clickable" onClick="switch_performance_view('performance-by-the-day')"><%= t('qa_server.monitor_status.performance.menu_month') %></li>
143
- <li class="selected"><%= t('qa_server.monitor_status.performance.menu_year') %></li>
144
- </ul>
145
- </div>
146
-
147
- <div id="performance-chart-by-the-month" class="performance-chart">
148
- <p>Data for the last 12 months</p>
149
- <%= image_tag(@presenter.performance_for_year_graph, alt: 'Performance data for the last 12 months.') %>
150
- </div>
151
- </div>
152
- </div>
153
- <% end %>
154
-
155
- <% if @presenter.display_performance_datatable? %>
156
- <table class="status">
157
- <tr>
158
- <th></th>
159
- <th><%= t('qa_server.monitor_status.performance.slowest_times') %></th>
160
- <th><%= t('qa_server.monitor_status.performance.average_times') %></th>
161
- <th><%= t('qa_server.monitor_status.performance.fastest_times') %></th>
162
- </tr>
163
- <% @presenter.performance_data.each do |authority_name, data| %>
164
- <% stats = @presenter.lifetime_stats(data) %>
165
- <tr>
166
- <td class="table_subheading" colspan="4"><%= authority_name %></td>
167
- </tr>
168
- <tr>
169
- <th><%= t('qa_server.monitor_status.performance.load_times') %></th>
170
- <td class="<%= @presenter.max_load_style(stats) %>"><%= @presenter.max_load(stats) %></td>
171
- <td class="<%= @presenter.avg_load_style(stats) %>"><%= @presenter.avg_load(stats) %></td>
172
- <td class="<%= @presenter.min_load_style(stats) %>"><%= @presenter.min_load(stats) %></td>
173
- </tr>
174
- <tr>
175
- <th><%= t('qa_server.monitor_status.performance.normalization_times') %></th>
176
- <td class="<%= @presenter.max_normalization_style(stats) %>"><%= @presenter.max_normalization(stats) %></td>
177
- <td class="<%= @presenter.avg_normalization_style(stats) %>"><%= @presenter.avg_normalization(stats) %></td>
178
- <td class="<%= @presenter.min_normalization_style(stats) %>"><%= @presenter.min_normalization(stats) %></td>
179
- </tr>
180
- <tr>
181
- <th><%= t('qa_server.monitor_status.performance.full_request_times') %></th>
182
- <td class="<%= @presenter.max_full_request_style(stats) %>"><%= @presenter.max_full_request(stats) %></td>
183
- <td class="<%= @presenter.avg_full_request_style(stats) %>"><%= @presenter.avg_full_request(stats) %></td>
184
- <td class="<%= @presenter.min_full_request_style(stats) %>"><%= @presenter.min_full_request(stats) %></td>
185
- </tr>
186
- <% end %>
187
- </table>
188
- <% end %>
189
- <% end %>
190
11
  </div>
@@ -88,12 +88,16 @@ en:
88
88
  y_axis_ms: Milliseconds (ms)
89
89
  now: NOW
90
90
  today: TODAY
91
- authority: Authority
92
- average_times: Average (ms)
93
- fastest_times: Fastest (ms)
94
- slowest_times: Slowest (ms)
95
- load_times: Load
96
- normalization_times: Normalization
97
- full_request_times: Total
91
+ datatable_day_desc: 'Performance tabulated data for last 24 hours'
92
+ datatable_month_desc: 'Performance tabulated data for last 30 days'
93
+ datatable_year_desc: 'Performance tabulated data for one year'
94
+ datatable_all_desc: 'Performance tabulated data for all recorded data'
95
+ authority: Authority
96
+ average_times: Average (ms)
97
+ fastest_times: 10th percentile (ms)
98
+ slowest_times: 90th percentile (ms)
99
+ load_times: Load
100
+ normalization_times: Normalization
101
+ full_request_times: Total
98
102
  usage:
99
103
  title: Usage
@@ -12,10 +12,36 @@ QaServer.config do |config|
12
12
  # @param [Boolean] display performance graph when true
13
13
  # config.display_performance_graph = false
14
14
 
15
+ # Color of the graph line for load times in the performance graphs.
16
+ # @param [String] color RGB code
17
+ # @note The default colors for the load, normalization, and full request lines in the performance graph are accessible.
18
+ # config.performance_load_color = '#ABC3C9'
19
+
20
+ # Color of the graph line for normalization times (The default colors for the performance graph are accessible.)
21
+ # @param [String] color RGB code
22
+ # @note The default colors for the load, normalization, and full request lines in the performance graph are accessible.
23
+ # config.performance_normalization_color = '#CCBE9F'
24
+
25
+ # Performance graph default time period for all graphs. All authorities will show the graph for this time period on page load.
26
+ # @param [String] :day, :month, or :year
27
+ # config.performance_graph_default_time_period = :month
28
+
15
29
  # Displays a datatable of performance test data when true
16
30
  # @param [Boolean] display performance datatable when true
17
31
  # config.display_performance_datatable = true
18
32
 
33
+ # Performance datatable default time period for calculating stats.
34
+ # @param [String] :day, :month, :year, :all
35
+ # config.performance_datatable_default_time_period = :year
36
+
37
+ # Performance datatable targeted maximum full request time.
38
+ # @param [Integer] targeted maximum full request time in ms
39
+ # config.performance_datatable_max_threshold = 1500
40
+
41
+ # Performance datatable targeted warning full request time.
42
+ # @param [Integer] targeted warning full request time in ms
43
+ # config.performance_datatable_warning_threshold = 1000
44
+
19
45
  # Additional menu items to add to the main navigation menu's set of left justified menu items
20
46
  # @param [Array<Hash<String,String>>] array of menu items to append with hash label: is menu item label to display and hash url: is URL for the menu item link
21
47
  # config.navmenu_extra_leftitems = [
@@ -25,6 +25,27 @@ module QaServer
25
25
  @display_performance_graph = false
26
26
  end
27
27
 
28
+ # Color of the graph line for load times
29
+ # @param [String] color RGB code
30
+ attr_writer :performance_load_color
31
+ def performance_load_color
32
+ @performance_load_color ||= '#ABC3C9'
33
+ end
34
+
35
+ # Color of the graph line for normalization times
36
+ # @param [String] color RGB code
37
+ attr_writer :performance_normalization_color
38
+ def performance_normalization_color
39
+ @performance_normalization_color ||= '#CCBE9F'
40
+ end
41
+
42
+ # Performance graph default time period for all graphs. All authorities will show the graph for this time period on page load.
43
+ # @param [String] :day, :month, or :year
44
+ attr_writer :performance_graph_default_time_period
45
+ def performance_graph_default_time_period
46
+ @performance_graph_default_time_period ||= :month
47
+ end
48
+
28
49
  # Displays a datatable of performance test data when true
29
50
  # @param [Boolean] display performance datatable when true
30
51
  attr_writer :display_performance_datatable
@@ -33,6 +54,27 @@ module QaServer
33
54
  @display_performance_datatable = true
34
55
  end
35
56
 
57
+ # Performance datatable default time period for calculating stats.
58
+ # @param [String] :day, :month, :year, :all
59
+ attr_writer :performance_datatable_default_time_period
60
+ def performance_datatable_default_time_period
61
+ @performance_datatable_default_time_period ||= :year
62
+ end
63
+
64
+ # Performance datatable targeted maximum full request time.
65
+ # @param [Integer] targeted maximum full request time in ms
66
+ attr_writer :performance_datatable_max_threshold
67
+ def performance_datatable_max_threshold
68
+ @performance_datatable_max_threshold ||= 1500
69
+ end
70
+
71
+ # Performance datatable targeted warning full request time.
72
+ # @param [Integer] targeted warning full request time in ms
73
+ attr_writer :performance_datatable_warning_threshold
74
+ def performance_datatable_warning_threshold
75
+ @performance_datatable_warning_threshold ||= 1000
76
+ end
77
+
36
78
  # Additional menu items to add to the main navigation menu's set of left justified menu items
37
79
  # @param [Array<Hash<String,String>>] array of menu items to append with hash key = menu item label to display and hash value = URL for the menu item link
38
80
  # @example
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module QaServer
3
- VERSION = '2.2.1'
3
+ VERSION = '2.2.2'
4
4
  end