rorvswild 1.5.2 → 1.5.7
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 +4 -4
- data/README.md +28 -2
- data/lib/rorvswild/client.rb +7 -2
- data/lib/rorvswild/installer.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/middleware.rb +31 -0
- data/lib/rorvswild/version.rb +1 -1
- metadata +7 -5
- data/lib/rorvswild/plugin/action_dispatch.rb +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 185e306b95a9f95fe78161e62e5e8e03d43ce8f892ad2350882ba44e07ba7d9e
|
4
|
+
data.tar.gz: 8b5e2bba0d15a48f1bde89cd804bd56535e957069b6b1acd59ccec96ec4d2857
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15ae6b40fcf59aa4eabe7db0b0068239b49cd4311d2a03014484110fc51c5574ee00b068549298c720aef4bbe2f9280c480b026887589b999a0f41792b89d116
|
7
|
+
data.tar.gz: bd616d7f191bf7296a4d537e4e9edd81bc4d791e46ecd237da8370c5d3031c697eb43545c429ff2040e8a9e41df2cce68ff1e9a077e2ac1a4a65fa4eb4f05453
|
data/README.md
CHANGED
@@ -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
|
|
@@ -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
@@ -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)
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module RorVsWild
|
2
|
+
module Plugin
|
3
|
+
class Middleware
|
4
|
+
def self.setup
|
5
|
+
return if @installed
|
6
|
+
Rails.application.config.middleware.unshift(RorVsWild::Plugin::Middleware, nil) if defined?(Rails)
|
7
|
+
@installed = true
|
8
|
+
end
|
9
|
+
|
10
|
+
def initialize(app, config)
|
11
|
+
@app, @config = app, config
|
12
|
+
end
|
13
|
+
|
14
|
+
def call(env)
|
15
|
+
RorVsWild.agent.start_request
|
16
|
+
RorVsWild.agent.current_data[:path] = env["ORIGINAL_FULLPATH".freeze]
|
17
|
+
section = RorVsWild::Section.start
|
18
|
+
section.file, section.line = rails_engine_location
|
19
|
+
section.command = "Rails::Engine#call".freeze
|
20
|
+
@app.call(env)
|
21
|
+
ensure
|
22
|
+
RorVsWild::Section.stop
|
23
|
+
RorVsWild.agent.stop_request
|
24
|
+
end
|
25
|
+
|
26
|
+
def rails_engine_location
|
27
|
+
@rails_engine_location = ::Rails::Engine.instance_method(:call).source_location
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
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.7
|
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-08-25 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: []
|
@@ -39,7 +41,6 @@ files:
|
|
39
41
|
- lib/rorvswild/local/stylesheet/vendor/prism.css
|
40
42
|
- lib/rorvswild/locator.rb
|
41
43
|
- lib/rorvswild/plugin/action_controller.rb
|
42
|
-
- lib/rorvswild/plugin/action_dispatch.rb
|
43
44
|
- lib/rorvswild/plugin/action_mailer.rb
|
44
45
|
- lib/rorvswild/plugin/action_view.rb
|
45
46
|
- lib/rorvswild/plugin/active_job.rb
|
@@ -47,6 +48,7 @@ files:
|
|
47
48
|
- lib/rorvswild/plugin/delayed_job.rb
|
48
49
|
- lib/rorvswild/plugin/elasticsearch.rb
|
49
50
|
- lib/rorvswild/plugin/faktory.rb
|
51
|
+
- lib/rorvswild/plugin/middleware.rb
|
50
52
|
- lib/rorvswild/plugin/mongo.rb
|
51
53
|
- lib/rorvswild/plugin/net_http.rb
|
52
54
|
- lib/rorvswild/plugin/redis.rb
|
@@ -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: []
|
@@ -1,27 +0,0 @@
|
|
1
|
-
module RorVsWild
|
2
|
-
module Plugin
|
3
|
-
class ActionDispatch
|
4
|
-
def self.setup
|
5
|
-
return if @installed
|
6
|
-
return unless defined?(::ActiveSupport::Notifications)
|
7
|
-
ActiveSupport::Notifications.subscribe("request.action_dispatch", new)
|
8
|
-
@installed = true
|
9
|
-
end
|
10
|
-
|
11
|
-
def start(name, id, payload)
|
12
|
-
RorVsWild.agent.start_request
|
13
|
-
RorVsWild.agent.current_data[:path] = payload[:request].original_fullpath
|
14
|
-
@action_dispath_location ||= ::ActionDispatch::Executor.instance_method(:call).source_location
|
15
|
-
section = RorVsWild::Section.start
|
16
|
-
section.file, section.line = @action_dispath_location
|
17
|
-
section.command = "ActionDispatch::Executor.#call".freeze
|
18
|
-
section.kind = "code".freeze
|
19
|
-
end
|
20
|
-
|
21
|
-
def finish(name, id, payload)
|
22
|
-
RorVsWild::Section.stop
|
23
|
-
RorVsWild.agent.stop_request
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|