rorvswild 1.5.4 → 1.5.9

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: 823ab7934d6f40bcf1e9cea8b11b67709fdf3291ee7f751c214bc326f27ffb57
4
- data.tar.gz: d886b176eeb69afc9c02e927cf783319d310e9854160aac9769ec0fb8fe4b0b3
3
+ metadata.gz: 82e99bed32ec2670bc121da6de38cdfa320cf2d86f1e09004f08629eab6c0040
4
+ data.tar.gz: d92ed6e8faa815ff9be3dd3d6ee8528a5c9b43824c803616c0106276111baf45
5
5
  SHA512:
6
- metadata.gz: afc6de959ccc4f34dad4fd318c55a2bb55d844b66dfed98acada8c729f84cdad334f28394178ed90cc11582b95da94b35b101467bc0e6cda806cf14482814635
7
- data.tar.gz: c2a28c624fd45b76adc2b3718dc3994db0418166de4b3b40d51d5eb11f72f4a9405d9a752c6dac1f98a632cda0f632117387dea08fa4982aa524cbc38b1b91b0
6
+ metadata.gz: 3b48fea4d285459afe675e47cde1a2ca2cd658f09dcc742b8f425e83dfa346714940688bbcbd83a356db24c154ea7bb15643b68e673714563a35261416cc6eec
7
+ data.tar.gz: 3162a68b10887ea2733757f7bd7cf3edb8b76479e6f558ac2f096aa3e9225486350dca307c22611743448cc0801b0883c42b42b16f25cf6096e39586c6c34955
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![Gem Version](https://badge.fury.io/rb/rorvswild.svg)](https://badge.fury.io/rb/rorvswild)
5
5
  [![Maintainability](https://api.codeclimate.com/v1/badges/2c4805cf658d7af794fe/maintainability)](https://codeclimate.com/github/BaseSecrete/rorvswild/maintainability)
6
6
 
7
- <img align="right" src="/images/rorvswild_logo.jpg">
7
+ <img align="right" src="./images/rorvswild_logo.jpg">
8
8
 
9
9
  *RoRvsWild* is a ruby gem to monitor performances and exceptions in Ruby on Rails applications.
10
10
 
@@ -21,7 +21,7 @@ It can also be used in your production and staging environments with an account
21
21
  * Run `bundle install` in you terminal
22
22
  * Restart your local server and you’ll see a small button in the bottom left corner of your page.
23
23
 
24
- ![RoRvsWild Local Button](/images/rorvswild_local_button.jpg)
24
+ ![RoRvsWild Local Button](./images/rorvswild_local_button.jpg)
25
25
 
26
26
  This is all what you need to do to monitor your local environment requests.
27
27
 
@@ -32,11 +32,11 @@ Signup on https://www.rorvswild.com and create an app to get one.
32
32
 
33
33
  * Add in your Gemfile `gem "rorvswild"`
34
34
  * Run `bundle install` in you terminal
35
- * Run `rorvswild-setup API_KEY` in you terminal
35
+ * Run `rorvswild-install API_KEY` in you terminal
36
36
  * Deploy/Restart your app
37
37
  * Make a few requests and refresh your app page on rorvswild.com to view the dashboard.
38
38
 
39
- The `rorvswild-setup` command creates a `config/rorvswild.yml` file.
39
+ The `rorvswild-install` command creates a `config/rorvswild.yml` file.
40
40
 
41
41
  If you prefer to use an initializer, you can do the following:
42
42
 
@@ -49,7 +49,7 @@ You can create unlimited apps on *rorvswild.com*. If you want to monitor your st
49
49
 
50
50
  ## Development mode: *RoRvsWild Local*
51
51
 
52
- ![RoRvsWild Local](/images/rorvswild_local.jpg)
52
+ ![RoRvsWild Local](./images/rorvswild_local.jpg)
53
53
 
54
54
  *RorVsWild Local* monitors the performances of requests in development environment.
55
55
  It shows most of the requests performances insights *RoRvsWild.com* displays. **A big difference is everything works locally and no data is sent and recorded on our servers**. You don’t even need an account to use it.
@@ -69,7 +69,7 @@ If you are using `Rack::Deflater` middleware you won't see the small button in t
69
69
 
70
70
  ## Production mode: *RoRvsWild.com*
71
71
 
72
- ![RoRvsWild.com](/images/rorvswild_prod.jpg)
72
+ ![RoRvsWild.com](./images/rorvswild_prod.jpg)
73
73
 
74
74
  *RoRvsWild.com* makes it easy to monitor requests, background jobs and errors in your production and staging environment.
75
75
  It also comes with some extra options listed below.
@@ -1,4 +1,6 @@
1
1
  require "logger"
2
+ require "socket"
3
+ require "etc"
2
4
 
3
5
  module RorVsWild
4
6
  class Agent
@@ -26,7 +28,7 @@ module RorVsWild
26
28
  @config = self.class.default_config.merge(config)
27
29
  @client = Client.new(@config)
28
30
  @queue = config[:queue] || Queue.new(client)
29
- @locator = RorVsWild::Locator.new(defined?(Rails) ? Rails.root.to_s : ENV["PWD"])
31
+ @locator = RorVsWild::Locator.new
30
32
 
31
33
  RorVsWild.logger.info("Start RorVsWild #{RorVsWild::VERSION}")
32
34
  setup_plugins
@@ -72,7 +74,7 @@ module RorVsWild
72
74
  begin
73
75
  block.call
74
76
  rescue Exception => ex
75
- push_exception(ex, parameters: parameters)
77
+ push_exception(ex, parameters: parameters, job: {name: name})
76
78
  raise
77
79
  ensure
78
80
  current_data[:runtime] = RorVsWild.clock_milliseconds - current_data[:started_at]
@@ -168,11 +170,26 @@ module RorVsWild
168
170
  backtrace: exception.backtrace || ["No backtrace"],
169
171
  exception: exception.class.to_s,
170
172
  extra_details: extra_details,
173
+ environment: {
174
+ os: os_description,
175
+ user: Etc.getlogin,
176
+ host: Socket.gethostname,
177
+ ruby: RUBY_DESCRIPTION,
178
+ pid: Process.pid,
179
+ cwd: Dir.pwd,
180
+ lib_paths: locator.lib_paths,
181
+ },
171
182
  }
172
183
  end
173
184
 
174
185
  def ignored_exception?(exception)
175
186
  (config[:ignored_exceptions] || config[:ignore_exceptions]).include?(exception.class.to_s)
176
187
  end
188
+
189
+ def os_description
190
+ @os_description ||= `uname -a`
191
+ rescue Exception => ex
192
+ @os_description = RUBY_PLATFORM
193
+ end
177
194
  end
178
195
  end
@@ -21,12 +21,17 @@ module RorVsWild
21
21
  @connection_count = 0
22
22
  @mutex = Mutex.new
23
23
  @config = config
24
+ @headers = {
25
+ "Content-Type" => "application/json",
26
+ "X-RorVsWild-Version" => RorVsWild::VERSION,
27
+ "X-Ruby-Version" => RUBY_VERSION,
28
+ }
29
+ @headers["X-Rails-Version"] = Rails.version if defined?(Rails)
24
30
  end
25
31
 
26
32
  def post(path, data)
27
33
  uri = URI(api_url + path)
28
- post = Net::HTTP::Post.new(uri.path, "X-Gem-Version".freeze => RorVsWild::VERSION)
29
- post.content_type = "application/json".freeze
34
+ post = Net::HTTP::Post.new(uri.path, @headers)
30
35
  post.basic_auth(nil, api_key)
31
36
  post.body = data.to_json
32
37
  transmit(post)
@@ -46,6 +51,7 @@ module RorVsWild
46
51
 
47
52
  def take_or_create_connection
48
53
  if http = take_connection
54
+ http.start unless http.active?
49
55
  http
50
56
  elsif @connection_count < max_connections
51
57
  @connection_count += 1
@@ -57,6 +63,8 @@ module RorVsWild
57
63
  if http = take_or_create_connection
58
64
  http.request(request)
59
65
  end
66
+ rescue Exception => ex
67
+ RorVsWild.logger.error(ex.full_message)
60
68
  ensure
61
69
  release_connection(http)
62
70
  end
@@ -65,6 +73,7 @@ module RorVsWild
65
73
  uri = URI(api_url)
66
74
  http = Net::HTTP.new(uri.host, uri.port)
67
75
  http.open_timeout = timeout
76
+ http.keep_alive_timeout = 5
68
77
 
69
78
  if uri.scheme == HTTPS
70
79
  # Disable peer verification while there is a memory leak with OpenSSL
@@ -26,6 +26,7 @@ module RorVsWild
26
26
 
27
27
  def serve_embed_profiler(env)
28
28
  status, headers, body = app.call(env)
29
+ status = status.to_i
29
30
  if status >= 200 && status < 300 && headers["Content-Type"] && headers["Content-Type"].include?("text/html")
30
31
  if headers["Content-Encoding"]
31
32
  log_incompatible_middleware_warning
@@ -5,7 +5,7 @@
5
5
  .rorvswild-local-toggler {
6
6
  background: #1d242f !important;
7
7
  color: #80abe3 !important;
8
- box-shadow: 0 0 0 1px rgba(159, 169, 187, 0.3), 0 1px 4px 0px rgba(25, 32, 42, .9) !important;
8
+ box-shadow: 0 0 0 1px rgba(159, 169, 187, 0.3), 0 1px 4px 0px rgba(25, 32, 42, 0.9) !important;
9
9
  border-radius: 4px !important;
10
10
  font-family: SF Mono, Menlo, Consolas, DejaVu Sans Mono, monospace !important;
11
11
  font-size: 15px !important;
@@ -13,10 +13,11 @@
13
13
  position: fixed !important;
14
14
  bottom: 12px !important;
15
15
  left: 12px !important;
16
- padding:0 12px !important;
16
+ padding: 0 12px !important;
17
17
  cursor: pointer !important;
18
18
  z-index: 100000000000000003 !important;
19
19
  }
20
+
20
21
  .rorvswild-local-toggler small {
21
22
  color: #9fa9bb !important;
22
23
  font-size: 12px !important;
@@ -30,7 +31,7 @@
30
31
 
31
32
  .rorvswild-local-panel {
32
33
  background: #1d242f !important;
33
- box-shadow: 0 0 0 48px rgba(25, 32, 42, .9) !important;
34
+ box-shadow: 0 0 0 48px rgba(25, 32, 42, 0.9) !important;
34
35
  color: #eceef1 !important;
35
36
  font-family: SF Mono, Menlo, Consolas, DejaVu Sans Mono, monospace !important;
36
37
  font-size: 15px !important;
@@ -84,6 +85,7 @@
84
85
  display: -ms-flexbox;
85
86
  display: flex;
86
87
  }
88
+
87
89
  .rorvswild-local-panel__header__title {
88
90
  color: #9fa9bb !important;
89
91
  text-transform: uppercase !important;
@@ -94,6 +96,7 @@
94
96
  -ms-flex: 1;
95
97
  flex: 1;
96
98
  }
99
+
97
100
  .rorvswild-local-panel svg {
98
101
  height: 24px !important;
99
102
  width: 24px !important;
@@ -104,12 +107,15 @@
104
107
  stroke-miterlimit: 10 !important;
105
108
  vertical-align: middle !important;
106
109
  }
110
+
107
111
  .rorvswild-local-panel svg:hover {
108
112
  stroke: #eceef1 !important;
109
113
  }
114
+
110
115
  .rorvswild-local-panel__logo {
111
116
  width: 60px !important;
112
117
  }
118
+
113
119
  .rorvswild-local-panel__header__icons {
114
120
  width: 60px !important;
115
121
  display: -webkit-box !important;
@@ -119,14 +125,17 @@
119
125
  -ms-flex-pack: end !important;
120
126
  justify-content: flex-end !important;
121
127
  }
128
+
122
129
  .rorvswild-local-panel__close {
123
130
  cursor: pointer !important;
124
131
  margin-left: 12px !important;
125
132
  }
133
+
126
134
  .rorvswild-local-panel__github svg {
127
135
  stroke: none !important;
128
136
  fill: #9fa9bb !important;
129
137
  }
138
+
130
139
  .rorvswild-local-panel__github svg:hover {
131
140
  stroke: none !important;
132
141
  fill: #eceef1 !important;
@@ -136,17 +145,21 @@
136
145
 
137
146
  .rorvswild-local-panel__content {
138
147
  -webkit-box-flex: 1 !important;
139
- -ms-flex: 1 !important;
140
- flex: 1 !important;
148
+ -ms-flex: 1 !important;
149
+ flex: 1 !important;
141
150
  height: calc(100% - 48px) !important;
142
151
  overflow-x: auto !important;
143
152
  }
153
+
144
154
  .rorvswild-local-panel__content::-webkit-scrollbar { width: 3px !important; }
155
+
145
156
  .rorvswild-local-panel__content::-webkit-scrollbar-corner { background: transparent !important; }
157
+
146
158
  .rorvswild-local-panel__content::-webkit-scrollbar-track {
147
- box-shadow: inset 0 0 0 rgba(0,0,0,0.3) !important;
159
+ box-shadow: inset 0 0 0 rgba(0, 0, 0, 0.3) !important;
148
160
  background: transparent !important;
149
161
  }
162
+
150
163
  .rorvswild-local-panel__content::-webkit-scrollbar-thumb {
151
164
  background-color: #9fa9bb !important;
152
165
  outline: 1px solid #9fa9bb !important;
@@ -162,18 +175,22 @@
162
175
  border-bottom: 1px solid rgba(25, 32, 42, 1) !important;
163
176
  cursor: pointer !important;
164
177
  -ms-flex-wrap: wrap !important;
165
- flex-wrap: wrap !important;
178
+ flex-wrap: wrap !important;
166
179
  }
180
+
167
181
  .rorvswild-local-panel__request:hover { background: #222835 !important; }
182
+
168
183
  .rorvswild-local-panel__request__name {
169
184
  word-break: break-all !important;
170
185
  overflow-wrap: break-word !important;
171
186
  width: 100% !important;
172
187
  }
188
+
173
189
  .rorvswild-local-panel__request__path {
174
190
  color: #9fa9bb !important;
175
191
  display: block !important;
176
192
  }
193
+
177
194
  .rorvswild-local-panel__request__started-at {
178
195
  color: #9fa9bb !important;
179
196
  margin-left: 12px !important;
@@ -187,6 +204,7 @@
187
204
  cursor: pointer !important;
188
205
  display: block !important;
189
206
  }
207
+
190
208
  .rorvswild-local-panel__request-details__request {
191
209
  display: -webkit-box !important;
192
210
  display: -ms-flexbox !important;
@@ -194,8 +212,9 @@
194
212
  margin-bottom: 48px !important;
195
213
  padding: 12px 12px 0 !important;
196
214
  -ms-flex-wrap: wrap !important;
197
- flex-wrap: wrap !important;
215
+ flex-wrap: wrap !important;
198
216
  }
217
+
199
218
  h2.rorvswild-local-panel__request__name__title {
200
219
  margin:-18px 0 0 !important;
201
220
  padding:0 !important;
@@ -213,6 +232,7 @@ h2.rorvswild-local-panel__request__name__title {
213
232
  border-bottom: 1px solid rgba(25, 32, 42, 1) !important;
214
233
  display: block !important;
215
234
  }
235
+
216
236
  .rorvswild-local-panel__request-details__section:hover {
217
237
  background: #212834 !important;
218
238
  -webkit-transition: all .3s !important;
@@ -227,31 +247,37 @@ h2.rorvswild-local-panel__request__name__title {
227
247
  -ms-flex-wrap: wrap !important;
228
248
  flex-wrap: wrap !important;
229
249
  }
250
+
230
251
  .rorvswild-local-panel__request-details__section__file {
231
252
  width: 100% !important;
232
253
  word-break: break-all !important;
233
254
  overflow-wrap: break-word !important;
234
255
  min-width: 0 !important;
235
256
  }
257
+
236
258
  .rorvswild-local-panel__request-details__section__average {
237
259
  color: #80abe3 !important;
238
260
  width: 48px !important;
239
261
  margin:0 12px 0 0 !important;
240
262
  }
263
+
241
264
  .rorvswild-local-panel__request-details__section__calls {
242
265
  color: #9fa9bb !important;
243
266
  width: 48px !important;
244
- margin:0 12px 0 0 !important;
267
+ margin: 0 12px 0 0 !important;
245
268
  }
269
+
246
270
  .rorvswild-local-panel__request-details__section__impact {
247
271
  width: 48px !important;
248
- margin:0 12px 0 0 !important;
272
+ margin: 0 12px 0 0 !important;
249
273
  }
274
+
250
275
  .rorvswild-local-panel__request-details__section__code {
251
276
  display: -webkit-box !important;
252
277
  display: -ms-flexbox !important;
253
278
  display: flex !important;
254
279
  }
280
+
255
281
  .rorvswild-local-panel__request-details__section__kind {
256
282
  background: rgba(25, 32, 42, 1) !important;
257
283
  font-size: 10px !important;
@@ -262,18 +288,15 @@ h2.rorvswild-local-panel__request__name__title {
262
288
  height: 24px !important;
263
289
  display: inline-block !important;
264
290
  }
291
+
265
292
  .rorvswild-local-panel__request-details__section__command {
266
- overflow: hidden !important;
267
293
  color: #9fa9bb !important;
268
- margin-left: 12px !important;
269
294
  -webkit-box-flex: 1 !important;
270
- -ms-flex: 1 !important;
271
- flex: 1 !important;
272
- opacity: .6 !important;
273
- }
274
-
275
- .rorvswild-local-panel__request-details__section:hover .rorvswild-local-panel__request-details__section__command {
276
- opacity: 1 !important;
295
+ -ms-flex: 1 !important;
296
+ flex: 1 !important;
297
+ margin-left: 12px !important;
298
+ opacity: 1;
299
+ overflow: hidden !important;
277
300
  }
278
301
 
279
302
  /* Panel Footer */
@@ -285,6 +308,7 @@ h2.rorvswild-local-panel__request__name__title {
285
308
  padding: 12px !important;
286
309
  text-align: center !important;
287
310
  }
311
+
288
312
  a.rorvswild-local-panel__footer__link {
289
313
  color: #eceef1 !important;
290
314
  text-decoration: underline !important;
@@ -296,33 +320,35 @@ a.rorvswild-local-panel__footer__link {
296
320
  @media screen and (min-width: 720px) {
297
321
  .rorvswild-local-panel__request-details__section__main {
298
322
  -ms-flex-wrap: nowrap !important;
299
- flex-wrap: nowrap !important;
323
+ flex-wrap: nowrap !important;
300
324
  }
301
325
 
302
326
  .rorvswild-local-panel__request__name {
303
327
  -webkit-box-flex: 1 !important;
304
- -ms-flex: 1 !important;
305
- flex: 1 !important;
328
+ -ms-flex: 1 !important;
329
+ flex: 1 !important;
306
330
  }
307
331
 
308
332
  .rorvswild-local-panel__request__runtime { margin-left: 12px !important; }
309
333
 
310
334
  .rorvswild-local-panel__request-details__section__file {
311
335
  -webkit-box-flex: 1 !important;
312
- -ms-flex: 1 !important;
313
- flex: 1 !important;
336
+ -ms-flex: 1 !important;
337
+ flex: 1 !important;
314
338
  }
315
339
 
316
340
  .rorvswild-local-panel__request-details__section__average {
317
341
  text-align: right !important;
318
- margin:0 0 0 12px !important;
342
+ margin: 0 0 0 12px !important;
319
343
  }
344
+
320
345
  .rorvswild-local-panel__request-details__section__calls {
321
346
  text-align: right !important;
322
- margin:0 0 0 12px !important;
347
+ margin: 0 0 0 12px !important;
323
348
  }
349
+
324
350
  .rorvswild-local-panel__request-details__section__impact {
325
351
  text-align: right !important;
326
- margin:0 0 0 12px !important;
352
+ margin: 0 0 0 12px !important;
327
353
  }
328
354
  }
@@ -25,9 +25,6 @@ http://prismjs.com/download.html?themes=prism-twilight&languages=markup+css+clik
25
25
  -ms-hyphens: none !important;
26
26
  hyphens: none !important;
27
27
 
28
- -webkit-filter: saturate(75%) !important; /* Safari 6.0 - 9.0 */
29
- filter: saturate(75%) !important;
30
-
31
28
  border-radius: 0 !important;
32
29
  border: 0 !important;
33
30
  box-shadow: 0 0 0 !important;
@@ -40,7 +37,6 @@ http://prismjs.com/download.html?themes=prism-twilight&languages=markup+css+clik
40
37
  background: transparent !important;
41
38
  }
42
39
 
43
-
44
40
  /* Text Selection colour */
45
41
  .rorvswild-local-panel pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
46
42
  .rorvswild-local-panel code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
@@ -66,7 +62,7 @@ http://prismjs.com/download.html?themes=prism-twilight&languages=markup+css+clik
66
62
  .rorvswild-local-panel .token.cdata {
67
63
  color: #9fa9bb !important;
68
64
  font-style: italic !important;
69
- opacity: 0.5 !important;
65
+ opacity: 0.7 !important;
70
66
  }
71
67
 
72
68
  .rorvswild-local-panel .token.punctuation {
@@ -89,7 +85,7 @@ http://prismjs.com/download.html?themes=prism-twilight&languages=markup+css+clik
89
85
  .rorvswild-local-panel .token.symbol,
90
86
  .rorvswild-local-panel .token.builtin,
91
87
  .rorvswild-local-panel .token.string {
92
- color: #67b6b2 !important;
88
+ color: #69b3c8 !important;
93
89
  }
94
90
 
95
91
  .rorvswild-local-panel .token.attr-name,
@@ -2,8 +2,8 @@ module RorVsWild
2
2
  class Locator
3
3
  attr_reader :current_path
4
4
 
5
- def initialize(current_path = ENV["PWD"])
6
- @current_path = current_path
5
+ def initialize(current_path = Dir.pwd)
6
+ @current_path = File.join(current_path, "")
7
7
  end
8
8
 
9
9
  def find_most_relevant_file_and_line(locations)
@@ -42,26 +42,21 @@ module RorVsWild
42
42
  end
43
43
 
44
44
  def irrelevant_path?(path)
45
- path.start_with?(*irrelevant_paths)
45
+ path.start_with?(*lib_paths)
46
46
  end
47
47
 
48
- def irrelevant_paths
49
- @irrelevant_paths ||= initialize_irrelevant_paths
48
+ def lib_paths
49
+ @lib_paths ||= initialize_lib_paths
50
50
  end
51
51
 
52
52
  private
53
53
 
54
- def initialize_irrelevant_paths
55
- array = ["RUBYLIB", "GEM_HOME", "GEM_PATH", "BUNDLER_ORIG_GEM_PATH"].flat_map do |name|
54
+ def initialize_lib_paths
55
+ array = [RbConfig::CONFIG["rubylibprefix"]] + Gem.default_path + Gem.path
56
+ array += ["RUBYLIB", "GEM_HOME", "GEM_PATH", "BUNDLER_ORIG_GEM_PATH"].flat_map do |name|
56
57
  ENV[name].split(":".freeze) if ENV[name]
57
58
  end
58
- array += [heroku_ruby_lib_path] if File.exists?(heroku_ruby_lib_path)
59
- array += Gem.path
60
59
  array.compact.uniq
61
60
  end
62
-
63
- def heroku_ruby_lib_path
64
- "/app/vendor/ruby-#{RUBY_VERSION}/lib"
65
- end
66
61
  end
67
62
  end
@@ -6,6 +6,11 @@ module RorVsWild
6
6
  return unless defined?(::ActionController::Base)
7
7
  ::ActionController::Base.around_action(&method(:around_action))
8
8
  ::ActionController::Base.rescue_from(StandardError) { |ex| RorVsWild::Plugin::ActionController.after_exception(ex, self) }
9
+
10
+ if defined?(::ActionController::API) && ::ActionController::API.respond_to?(:around_action)
11
+ ::ActionController::API.around_action(&method(:around_action))
12
+ ::ActionController::API.rescue_from(StandardError) { |ex| RorVsWild::Plugin::ActionController.after_exception(ex, self) }
13
+ end
9
14
  @installed = true
10
15
  end
11
16
 
@@ -14,7 +19,7 @@ module RorVsWild
14
19
  return block.call if RorVsWild.agent.ignored_request?(controller_action)
15
20
  begin
16
21
  RorVsWild::Section.start do |section|
17
- method_name = controller.method_for_action(controller.action_name)
22
+ method_name = controller.send(:method_for_action, controller.action_name)
18
23
  section.file, section.line = controller.method(method_name).source_location
19
24
  section.file = RorVsWild.agent.locator.relative_path(section.file)
20
25
  section.command = "#{controller.class}##{method_name}"
@@ -30,7 +35,12 @@ module RorVsWild
30
35
  if hash = RorVsWild.agent.push_exception(exception)
31
36
  hash[:session] = controller.session.to_hash
32
37
  hash[:parameters] = controller.request.filtered_parameters
33
- hash[:environment_variables] = extract_http_headers(controller.request.filtered_env)
38
+ hash[:request] = {
39
+ headers: extract_http_headers(controller.request.filtered_env),
40
+ name: "#{controller.class}##{controller.action_name}",
41
+ method: controller.request.method,
42
+ url: controller.request.url,
43
+ }
34
44
  end
35
45
  raise exception
36
46
  end
@@ -2,7 +2,9 @@ module RorVsWild
2
2
  module Plugin
3
3
  module Resque
4
4
  def self.setup
5
+ return if @installed
5
6
  ::Resque::Job.send(:extend, Resque) if defined?(::Resque::Job)
7
+ @installed = true
6
8
  end
7
9
 
8
10
  def around_perform_rorvswild(*args, &block)
@@ -66,5 +66,13 @@ module RorVsWild
66
66
  def command=(value)
67
67
  @command = value && value.size > COMMAND_MAX_SIZE ? value[0, COMMAND_MAX_SIZE] + " [TRUNCATED]" : value
68
68
  end
69
+
70
+ def to_h
71
+ {calls: calls, total_runtime: total_runtime, children_runtime: children_runtime, kind: kind, started_at: started_at, file: file, line: line, command: command}
72
+ end
73
+
74
+ def to_json(options = {})
75
+ to_h.to_json(options)
76
+ end
69
77
  end
70
78
  end
@@ -1,3 +1,3 @@
1
1
  module RorVsWild
2
- VERSION = "1.5.4".freeze
2
+ VERSION = "1.5.9".freeze
3
3
  end
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rorvswild
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.4
4
+ version: 1.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexis Bernard
8
+ - Antoine Marguerie
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2020-05-11 00:00:00.000000000 Z
12
+ date: 2021-02-19 00:00:00.000000000 Z
12
13
  dependencies: []
13
- description: Performances and quality insights for rails developers.
14
+ description: Performances and errors insights for rails developers.
14
15
  email:
15
16
  - alexis@bernard.io
17
+ - antoine@basesecrete.com
16
18
  executables:
17
19
  - rorvswild-install
18
20
  extensions: []
@@ -79,5 +81,5 @@ requirements: []
79
81
  rubygems_version: 3.0.3
80
82
  signing_key:
81
83
  specification_version: 4
82
- summary: Ruby on Rails app monitoring
84
+ summary: Ruby on Rails applications monitoring
83
85
  test_files: []