rails_performance 1.2.0.alpha5 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62aee36c96f068b8caf8a8f9ba1eb7b0c00f8c6493a8f609f0adaca7e0c11f9b
4
- data.tar.gz: b61d9ade77df9d29364694937e28fa57a029b497dc327872dc435006d412a136
3
+ metadata.gz: e9f2906db73d1a2227a6479131dded794f1b9bc734fe85883f91938ef28b4b7d
4
+ data.tar.gz: 04fbf2f661f9873878b36a10906eb2346883d9f44c236557bbbc423270506c66
5
5
  SHA512:
6
- metadata.gz: cb30056a19056d5b18c6f59af939e22bb4dda67adc0afb08d71ff4b215f4abac53bdd916e359e3655fa2e264be89d1b54af4dd8780bbfd1076e1b9d426c8d50a
7
- data.tar.gz: f4806fa7db15d691a9ecc95597b7d262ad28a739840ccfe949bf8815a1ac83dfa411a26cc13bb7343009b878f30a250ae9a43fc004b04253e3cb437f6f40aac1
6
+ metadata.gz: e3be04836a44e3c1eddc5b5f338667952128ee1d99b70bbb635bf252205f21e99a4c4d60157a3517927801de5342671d02f9648918074ecd60152fd7ec7c5222
7
+ data.tar.gz: ec663b71500e15c4c29bada3d11111629c3130281a0140a7a3e872068ac0eecc6e13cd50b0a867254a3ff03d472dfc6b29d0bb2cdea84ae212a48b04c3b8beaa
@@ -95,17 +95,13 @@ module RailsPerformance
95
95
  def bot_icon(user_agent)
96
96
  return nil if user_agent.blank?
97
97
 
98
- # TODO: clean this up
99
- # user_agent = "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/W.X.Y.Z Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
100
-
101
98
  browser = Browser.new(user_agent)
102
-
103
99
  if browser.bot?
104
100
  content_tag(:span, class: "user-agent-icon", title: browser.bot&.name) do
105
101
  icon("bot")
106
102
  end
107
103
  else
108
- content_tag(:span, class: "user-agent-icon user-agent-icon-user") do
104
+ content_tag(:span, class: "user-agent-icon user-agent-icon-user", title: "Real User") do
109
105
  icon("user")
110
106
  end
111
107
  end
@@ -7,13 +7,13 @@
7
7
  <% end %>
8
8
  </td>
9
9
  <td><%= format_datetime e[:datetime] %></td>
10
- <td><%= bot_icon e["user_agent"] %></td>
11
10
  <td>
12
11
  <% controller_action_info = e[:controller] + '#' + e[:action]%>
13
12
  <%= link_to truncate(controller_action_info, length: 40), rails_performance.rails_performance_summary_path({controller_eq: e[:controller], action_eq: e[:action]}), remote: true, title: controller_action_info %>
14
13
  </td>
15
14
  <td><%= e[:method] %></td>
16
15
  <td><%= e[:format] %></td>
16
+ <td><%= bot_icon e["user_agent"] %></td>
17
17
  <td><%= link_to_path(e) %></td>
18
18
  <td><%= status_tag e[:status] %></td>
19
19
  <td class="nowrap"><%= ms e[:duration] %></td>
@@ -5,11 +5,12 @@
5
5
  <div id="response_time_report_chart_mini" class="chart_mini"></div>
6
6
 
7
7
  <h2 class="subtitle"><%= title %></h2>
8
- <table class="table is-fullwidth is-hoverable is-narrow is-size-7">
8
+ <table class="table is-fullwidth is-hoverable is-narrow is-size-9">
9
9
  <thead>
10
10
  <tr>
11
11
  <th data-sort="string">Datetime</th>
12
12
  <th data-sort="string">Method</th>
13
+ <th></th>
13
14
  <th data-sort="string">Path</th>
14
15
  <th data-sort="string">Format</th>
15
16
  <th data-sort="int">Status</th>
@@ -23,6 +24,7 @@
23
24
  <tr>
24
25
  <td><%= format_datetime e[:datetime] %></td>
25
26
  <td><%= e[:method] %></td>
27
+ <td><%= bot_icon e["user_agent"] %></td>
26
28
  <td><%= link_to_path(e) %></td>
27
29
  <td><%= e[:format] %></td>
28
30
  <td><%= status_tag e[:status] %></td>
@@ -32,4 +34,4 @@
32
34
  </tr>
33
35
  <% end %>
34
36
  </tbody>
35
- </table>
37
+ </table>
@@ -8,6 +8,7 @@
8
8
  <th data-sort="string">Controller#action</th>
9
9
  <th data-sort="string">Method</th>
10
10
  <th data-sort="string">Format</th>
11
+ <th></th>
11
12
  <th data-sort="string">Path</th>
12
13
  <th data-sort="string">Exception</th>
13
14
  <th data-sort="string">Backtrace</th>
@@ -30,6 +31,7 @@
30
31
  <td><%= link_to e[:controller] + '#' + e[:action], rails_performance.rails_performance_summary_path({controller_eq: e[:controller], action_eq: e[:action]}), remote: true %></td>
31
32
  <td><%= e[:method] %></td>
32
33
  <td><%= e[:format] %></td>
34
+ <td><%= bot_icon e["user_agent"] %></td>
33
35
  <td><%= link_to_path(e) %></td>
34
36
  <td><%= e[:exception] %></td>
35
37
  <td class="very-small-text">
@@ -19,10 +19,10 @@
19
19
  <tr>
20
20
  <th data-sort="string"></th>
21
21
  <th data-sort="string">Datetime</th>
22
- <th></th>
23
22
  <th data-sort="string">Controller#action</th>
24
23
  <th data-sort="string">Method</th>
25
24
  <th data-sort="string">Format</th>
25
+ <th></th>
26
26
  <th data-sort="string">Path</th>
27
27
  <th data-sort="string">Status</th>
28
28
  <th data-sort="float">Duration</th>
@@ -13,10 +13,10 @@
13
13
  <tr>
14
14
  <th data-sort="string"></th>
15
15
  <th data-sort="string">Datetime</th>
16
- <th></th>
17
16
  <th data-sort="string">Controller#action</th>
18
17
  <th data-sort="string">Method</th>
19
18
  <th data-sort="string">Format</th>
19
+ <th></th>
20
20
  <th data-sort="string">Path</th>
21
21
  <th data-sort="string">Status</th>
22
22
  <th data-sort="float">Duration</th>
@@ -105,3 +105,13 @@ table th[data-sort] {
105
105
  #autoupdate_label {
106
106
  cursor: pointer;
107
107
  }
108
+
109
+ .is-size-8, .is-size-8 * {
110
+ font-size: 10px !important;
111
+ line-height: 20px !important;
112
+ }
113
+
114
+ .is-size-9, .is-size-9 * {
115
+ font-size: 7px !important;
116
+ line-height: 20px !important;
117
+ }
@@ -39,25 +39,15 @@ module RailsPerformance
39
39
  @data = []
40
40
  all = {}
41
41
 
42
- # puts "current: #{current}"
43
- # puts "stop: #{stop}"
44
-
45
42
  # read current values
46
43
  db.group_by(group).each do |(k, v)|
47
44
  yield(all, k, v)
48
45
  end
49
46
 
50
- # puts '----'
51
- # puts all
52
- # puts '----'
53
- # puts "offset: #{offset}"
54
- # puts '======='
55
-
56
47
  # add blank columns
57
48
  while current <= stop
58
- key = (current).strftime(RailsPerformance::FORMAT)
49
+ key = (current).strftime(RailsPerformance::FORMAT)
59
50
  views = all[key].presence || 0
60
- # puts "#{key} -> #{views}"
61
51
  @data << [(current.to_i + offset) * 1000, views.round(2)]
62
52
  current += 1.minute
63
53
  end
@@ -6,14 +6,6 @@ module RailsPerformance
6
6
  @group ||= :datetime
7
7
  end
8
8
 
9
- # def prepare_query(query = {})
10
- # RailsPerformance::Rails::QueryBuilder.compose_from({})
11
- # end
12
- # @datasource = RailsPerformance::DataSource.new(**prepare_query({}), type: :requests)
13
- # db = @datasource.db
14
- # RailsPerformance::Reports::ThroughputReport.new(db).data
15
- # Time.at(RailsPerformance::Reports::ThroughputReport.new(db).data.last[0] / 1000)
16
-
17
9
  def data
18
10
  calculate_data do |all, k, v|
19
11
  all[k] = v.count
@@ -1,4 +1,4 @@
1
1
  module RailsPerformance
2
- VERSION = '1.2.0.alpha5'
2
+ VERSION = '1.2.0'
3
3
  SCHEMA = '1.0.1'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_performance
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0.alpha5
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Kasyanchuk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-24 00:00:00.000000000 Z
11
+ date: 2023-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -330,9 +330,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
330
330
  version: '0'
331
331
  required_rubygems_version: !ruby/object:Gem::Requirement
332
332
  requirements:
333
- - - ">"
333
+ - - ">="
334
334
  - !ruby/object:Gem::Version
335
- version: 1.3.1
335
+ version: '0'
336
336
  requirements: []
337
337
  rubygems_version: 3.4.13
338
338
  signing_key: