qa_server 3.0.0 → 3.0.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c54a8298febf924d051837fef371b727c32912f7
4
- data.tar.gz: 5c038a7a516bd50834670fd393ee215086708b73
3
+ metadata.gz: 07b0fa2f20f5bb153db7ad23e9b220acac6c6207
4
+ data.tar.gz: 26780210f6c2e80b2be8964ec0bfa31fd24f962b
5
5
  SHA512:
6
- metadata.gz: a36a6e1d5072d3978a18a34b84bf338b9d318c7db8948a6fb8bbb3ae2506714e8281b4dfa42faae61f5410a3379d38c2e2c2077d848c14a8895ce9dfb7193fb8
7
- data.tar.gz: 1a5df12683d02f30c8bccc9f96d721faaffe06484223fe3ae543dc94f2948c11c164fa93a9833c57b0d523b898de54b19a02b344d5a56f9018d27f2a1b3a8304
6
+ metadata.gz: a32e34c94603bc1fa5cda525882ba8a60a1d7feb1afa190f081bfad7fc919895931f530c7847db6dace78d8639f4aa307d84fab1ff9d93ae525055a4cda1f4fb
7
+ data.tar.gz: 7eb0925bf1f3fc0cc4ee5a8afec876fa6a8fa8cbbd27417c3e844f3e9ab82f2516d95caf88fe93c9fc41188a78019e1e6c0a98d504237119f6fb4e47265275b6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 3.0.1 (2019-10-09)
2
+
3
+ * use old :load data when split :retrieve and :graph_load are not available
4
+ * bug fix - make sure count is counting based on the current set of times
5
+ * bug fix - add in missing translations
6
+ * bug fix - fix performance data table data style for retrieve
7
+ * bug fix - unsupported_action? for performance datatable handles all 0 stats
8
+
1
9
  ### 3.0.0 (2019-10-09)
2
10
 
3
11
  * refactor performance data and graphs to include stats by action as well as by authority and time period
@@ -105,7 +105,9 @@ module QaServer::MonitorStatus
105
105
  end
106
106
 
107
107
  def unsupported_action?(stats)
108
- stats[AVG_ACTN].nan?
108
+ values = stats.values
109
+ return true if values.all? &:zero?
110
+ values.any? { |v| v.respond_to?(:nan?) && v.nan? }
109
111
  end
110
112
 
111
113
  def format_stat(stats, idx)
@@ -21,6 +21,7 @@ module QaServer
21
21
  # retrieve_10th_ms: 12.3, graph_load_10th_ms: 12.3, normalization_10th_ms: 4.2, full_request_10th_ms: 16.5,
22
22
  # retrieve_90th_ms: 12.3, graph_load_90th_ms: 12.3, normalization_90th_ms: 4.2, full_request_90th_ms: 16.5 }
23
23
  def calculate_stats(avg: false, low: false, high: false, load: true, norm: true, full: true) # rubocop:disable Metrics/ParameterLists
24
+ calculate_load_stats(avg, low, high) if load
24
25
  calculate_retrieve_stats(avg, low, high) if load
25
26
  calculate_graph_load_stats(avg, low, high) if load
26
27
  calculate_normalization_stats(avg, low, high) if norm
@@ -30,6 +31,12 @@ module QaServer
30
31
 
31
32
  private
32
33
 
34
+ def calculate_load_stats(avg, low, high)
35
+ stats[AVG_LOAD] = calculate_average(full_load_times) if avg
36
+ stats[LOW_LOAD] = calculate_10th_percentile(full_load_times) if low
37
+ stats[HIGH_LOAD] = calculate_90th_percentile(full_load_times) if high
38
+ end
39
+
33
40
  def calculate_retrieve_stats(avg, low, high)
34
41
  stats[AVG_RETR] = calculate_average(retrieve_times) if avg
35
42
  stats[LOW_RETR] = calculate_10th_percentile(retrieve_times) if low
@@ -54,10 +61,6 @@ module QaServer
54
61
  stats[HIGH_ACTN] = calculate_90th_percentile(action_times) if high
55
62
  end
56
63
 
57
- def count
58
- @count ||= records.count
59
- end
60
-
61
64
  def tenth_percentile_count(times)
62
65
  percentile_count = (times.count * 0.1).round
63
66
  percentile_count = 1 if percentile_count.zero? && count > 1
@@ -69,6 +72,10 @@ module QaServer
69
72
  records.where(where_clause).where.not(column => nil).order(column).pluck(column)
70
73
  end
71
74
 
75
+ def full_load_times
76
+ @full_load_times ||= times(:retrieve_plus_graph_load_time_ms)
77
+ end
78
+
72
79
  def retrieve_times
73
80
  @retrieve_times ||= times(:retrieve_time_ms)
74
81
  end
@@ -86,8 +93,8 @@ module QaServer
86
93
  end
87
94
 
88
95
  def calculate_average(times)
89
- return 0 if count.zero?
90
- return times[0] if count == 1
96
+ return 0 if times.count.zero?
97
+ return times[0] if times.count == 1
91
98
  times.inject(0.0) { |sum, el| sum + el } / times.count
92
99
  end
93
100
 
@@ -82,18 +82,31 @@ module QaServer
82
82
 
83
83
  def rework_performance_data_for_gruff(performance_data, label_key)
84
84
  labels = {}
85
+ full_load_data = []
85
86
  retrieve_data = []
86
87
  graph_load_data = []
87
88
  normalization_data = []
88
89
  performance_data.each do |i, data|
89
90
  labels[i] = data[label_key]
90
91
  retrieve_data << data[STATS][AVG_RETR]
91
- graph_load_data << data[STATS][AVG_GRPH]
92
+ graph_load_data << graph_load_time(data)
92
93
  normalization_data << data[STATS][AVG_NORM]
93
94
  end
94
95
  [labels, normalization_data, graph_load_data, retrieve_data]
95
96
  end
96
97
 
98
+ def graph_load_time(data)
99
+ # For some sense of backward compatibility and to avoid losing the usefulness of previously collected data,
100
+ # create the graph using the old :load stat when both :retrieve and :graph_load are 0. If the value truly
101
+ # is 0, then :load will also be 0.
102
+ # NOTE: It's ok to use AVG_RETR for the retrieve data point because it is 0.
103
+ (data[STATS][AVG_RETR].zero? && data[STATS][AVG_GRPH].zero?) ? data[STATS][AVG_LOAD] : data[STATS][AVG_GRPH]
104
+ end
105
+
106
+ def empty(stat_data)
107
+ !stat_data.any? { |f| f > 0 }
108
+ end
109
+
97
110
  def performance_graph_theme(g, x_axis_label)
98
111
  g.theme_pastel
99
112
  g.colors = [QaServer.config.performance_normalization_color,
@@ -112,7 +112,7 @@
112
112
  </tr>
113
113
  <tr>
114
114
  <th><%= t('qa_server.monitor_status.performance.retrieve_times') %></th>
115
- <td class="<%= @presenter.high_full_request_style(search_stats) %>"><%= @presenter.high_retrieve(search_stats) %></td>
115
+ <td class="<%= @presenter.datatable_data_style(search_stats) %>"><%= @presenter.high_retrieve(search_stats) %></td>
116
116
  <td class="<%= @presenter.datatable_data_style(search_stats) %>"><%= @presenter.avg_retrieve(search_stats) %></td>
117
117
  <td class="<%= @presenter.datatable_data_style(search_stats) %>"><%= @presenter.low_retrieve(search_stats) %></td>
118
118
  <td class="<%= @presenter.datatable_data_style(fetch_stats) %>"><%= @presenter.high_retrieve(fetch_stats) %></td>
@@ -103,7 +103,8 @@ en:
103
103
  average_times: Average (ms)
104
104
  fastest_times: 10th percentile (ms)
105
105
  slowest_times: 90th percentile (ms)
106
- load_times: Load
106
+ retrieve_times: Retrieve
107
+ graph_load_times: Graph Load
107
108
  normalization_times: Normalization
108
109
  full_request_times: Total
109
110
  usage:
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module QaServer
3
- VERSION = '3.0.0'
3
+ VERSION = '3.0.1'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qa_server
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - E. Lynette Rayle