rorvswild 1.5.3 → 1.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +32 -6
- data/lib/rorvswild/client.rb +7 -2
- data/lib/rorvswild/installer.rb +1 -0
- data/lib/rorvswild/local/middleware.rb +1 -0
- data/lib/rorvswild/local/stylesheet/local.css +53 -27
- data/lib/rorvswild/local/stylesheet/vendor/prism.css +2 -6
- data/lib/rorvswild/plugin/action_controller.rb +20 -16
- data/lib/rorvswild/plugin/resque.rb +2 -0
- data/lib/rorvswild/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75f2fdba9fff15749762886844ffe4847fea3db15f6f777313625b4d88d3ccb4
|
4
|
+
data.tar.gz: 6f03efbb858658d3e7ed29e73d90926e2217d1d733aa0246a364cf13e4492391
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7e3227c4499002874c4d2cd96c97181098d71b433873c6f139e90223d2022cd51357f37e98a3277434797bd81ef1ca122af02a71b5373436c93a51ac15aba53
|
7
|
+
data.tar.gz: 9d848e8f284c5d359d675362a48c095df672ebcc4d55855225aaca119585d41e8dbb7359cdde0c540aba0c3a710dddda922c7fe87aab3030b53c0c4088115f8f
|
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="
|
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](
|
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-
|
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-
|
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](
|
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](
|
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.
|
@@ -167,6 +167,32 @@ Finally here is the list of all plugins you can ignore :
|
|
167
167
|
- Resque
|
168
168
|
- Sidekiq
|
169
169
|
|
170
|
+
#### Change logger
|
171
|
+
|
172
|
+
By default RorVsWild uses `Rails.logger` or standard output. However in some cases you want to isolate RorVsWild's logs.
|
173
|
+
To do that, you have to specifiy the log destination via the `logger` option :
|
174
|
+
|
175
|
+
```yaml
|
176
|
+
# config/rorvswild.yml
|
177
|
+
production:
|
178
|
+
api_key: API_KEY
|
179
|
+
logger: log/rorvswild.yml
|
180
|
+
```
|
181
|
+
|
182
|
+
Here is the equivalent if you prefer initialising RorVsWild manually :
|
183
|
+
|
184
|
+
```ruby
|
185
|
+
# config/initializers/rorvswild.rb
|
186
|
+
RorVsWild.start(api_key: "API_KEY", logger: "log/rorvswild.log")
|
187
|
+
```
|
188
|
+
|
189
|
+
In the case you want a custom logger such as Syslog, you can only do it by initialising it manually :
|
190
|
+
|
191
|
+
```ruby
|
192
|
+
# config/initializers/rorvswild.rb
|
193
|
+
RorVsWild.start(api_key: "API_KEY", logger: Logger::Syslog.new)
|
194
|
+
```
|
195
|
+
|
170
196
|
## Contributing
|
171
197
|
|
172
198
|
1. Fork it ( https://github.com/[my-github-username]/rorvswild/fork )
|
data/lib/rorvswild/client.rb
CHANGED
@@ -21,12 +21,13 @@ module RorVsWild
|
|
21
21
|
@connection_count = 0
|
22
22
|
@mutex = Mutex.new
|
23
23
|
@config = config
|
24
|
+
@headers = {"Content-Type" => "application/json", "X-Gem-Version" => RorVsWild::VERSION}
|
25
|
+
@headers["X-Rails-Version"] = Rails.version if defined?(Rails)
|
24
26
|
end
|
25
27
|
|
26
28
|
def post(path, data)
|
27
29
|
uri = URI(api_url + path)
|
28
|
-
post = Net::HTTP::Post.new(uri.path,
|
29
|
-
post.content_type = "application/json".freeze
|
30
|
+
post = Net::HTTP::Post.new(uri.path, @headers)
|
30
31
|
post.basic_auth(nil, api_key)
|
31
32
|
post.body = data.to_json
|
32
33
|
transmit(post)
|
@@ -46,6 +47,7 @@ module RorVsWild
|
|
46
47
|
|
47
48
|
def take_or_create_connection
|
48
49
|
if http = take_connection
|
50
|
+
http.start unless http.active?
|
49
51
|
http
|
50
52
|
elsif @connection_count < max_connections
|
51
53
|
@connection_count += 1
|
@@ -57,6 +59,8 @@ module RorVsWild
|
|
57
59
|
if http = take_or_create_connection
|
58
60
|
http.request(request)
|
59
61
|
end
|
62
|
+
rescue Exception => ex
|
63
|
+
RorVsWild.logger.error(ex.full_message)
|
60
64
|
ensure
|
61
65
|
release_connection(http)
|
62
66
|
end
|
@@ -65,6 +69,7 @@ module RorVsWild
|
|
65
69
|
uri = URI(api_url)
|
66
70
|
http = Net::HTTP.new(uri.host, uri.port)
|
67
71
|
http.open_timeout = timeout
|
72
|
+
http.keep_alive_timeout = 5
|
68
73
|
|
69
74
|
if uri.scheme == HTTPS
|
70
75
|
# Disable peer verification while there is a memory leak with OpenSSL
|
data/lib/rorvswild/installer.rb
CHANGED
@@ -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
|
-
|
140
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
271
|
-
|
272
|
-
|
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
|
-
|
323
|
+
flex-wrap: nowrap !important;
|
300
324
|
}
|
301
325
|
|
302
326
|
.rorvswild-local-panel__request__name {
|
303
327
|
-webkit-box-flex: 1 !important;
|
304
|
-
|
305
|
-
|
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
|
-
|
313
|
-
|
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.
|
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: #
|
88
|
+
color: #69b3c8 !important;
|
93
89
|
}
|
94
90
|
|
95
91
|
.rorvswild-local-panel .token.attr-name,
|
@@ -4,27 +4,31 @@ module RorVsWild
|
|
4
4
|
def self.setup
|
5
5
|
return if @installed
|
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
|
-
@installed = true
|
10
|
-
end
|
11
9
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
section = RorVsWild::Section.start
|
16
|
-
RorVsWild.agent.current_data[:name] = controller_action
|
17
|
-
controller = payload[:headers]["action_controller.instance".freeze]
|
18
|
-
method_name = controller.method_for_action(payload[:action])
|
19
|
-
section.file, section.line = controller.method(method_name).source_location
|
20
|
-
section.file = RorVsWild.agent.locator.relative_path(section.file)
|
21
|
-
section.command = "#{controller.class}##{method_name}"
|
22
|
-
section.kind = "code".freeze
|
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) }
|
23
13
|
end
|
14
|
+
@installed = true
|
24
15
|
end
|
25
16
|
|
26
|
-
def
|
27
|
-
|
17
|
+
def self.around_action(controller, block)
|
18
|
+
controller_action = "#{controller.class}##{controller.action_name}"
|
19
|
+
return block.call if RorVsWild.agent.ignored_request?(controller_action)
|
20
|
+
begin
|
21
|
+
RorVsWild::Section.start do |section|
|
22
|
+
method_name = controller.send(:method_for_action, controller.action_name)
|
23
|
+
section.file, section.line = controller.method(method_name).source_location
|
24
|
+
section.file = RorVsWild.agent.locator.relative_path(section.file)
|
25
|
+
section.command = "#{controller.class}##{method_name}"
|
26
|
+
RorVsWild.agent.current_data[:name] = controller_action
|
27
|
+
end
|
28
|
+
block.call
|
29
|
+
ensure
|
30
|
+
RorVsWild::Section.stop
|
31
|
+
end
|
28
32
|
end
|
29
33
|
|
30
34
|
def self.after_exception(exception, controller)
|
data/lib/rorvswild/version.rb
CHANGED
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
|
+
version: 1.5.8
|
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-
|
12
|
+
date: 2020-10-16 00:00:00.000000000 Z
|
12
13
|
dependencies: []
|
13
|
-
description: Performances and
|
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
|
84
|
+
summary: Ruby on Rails applications monitoring
|
83
85
|
test_files: []
|