rorvswild 1.4.3 → 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +28 -7
- data/lib/rorvswild/agent.rb +18 -19
- data/lib/rorvswild/client.rb +1 -1
- data/lib/rorvswild/installer.rb +18 -3
- data/lib/rorvswild/plugin/action_controller.rb +1 -1
- data/lib/rorvswild/plugins.rb +1 -15
- data/lib/rorvswild/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 171608a472bba02aca22c38a5ef435ed30f7de99
|
4
|
+
data.tar.gz: e3e0b6d5583d165c411cd9dfc437b5916a61f798
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66c87f4cd4eab22ece86273ec9ec1c8e0666410bb9312d0ed1e93ff87f339e61e6a261dacfb4056feb40a45b0ee1bc26d0ace366c41bc16b7f05df858d508a50
|
7
|
+
data.tar.gz: c636eda87ef43cf16a3f9e45e6d07f52c06506cd3040889cdac0ed1f360e9afebe614acd880f6b3593ba487bf5b858928344502f89aafdc191fc8fddb4af75be
|
data/README.md
CHANGED
@@ -120,30 +120,51 @@ RorVsWild.record_error(exception, {something: "important"})
|
|
120
120
|
RorVsWild.catch_error(something: "important") { 1 / 0 }
|
121
121
|
```
|
122
122
|
|
123
|
-
#### Ignore
|
123
|
+
#### Ignore requests, jobs, exceptions and plugins
|
124
124
|
|
125
|
-
|
125
|
+
From the configuration file, you can tell RorVsWild to skip monitoring some requests, jobs, exceptions and plugins.
|
126
126
|
|
127
127
|
```yaml
|
128
128
|
# config/rorvswild.yml
|
129
129
|
production:
|
130
130
|
api_key: API_KEY
|
131
|
-
|
131
|
+
ignore_requests:
|
132
132
|
- SecretController#index
|
133
|
+
ignore_jobs:
|
134
|
+
- SecretJob
|
133
135
|
ignore_exceptions:
|
134
|
-
- ActionController::RoutingError
|
136
|
+
- ActionController::RoutingError # Ignore by default any 404
|
135
137
|
- ZeroDivisionError
|
138
|
+
ignore_plugins:
|
139
|
+
- Sidekiq # If you don't want to monitor your Sidekiq jobs
|
136
140
|
```
|
137
141
|
|
142
|
+
Here is the equivalent if you prefer initializing RorVsWild manually.
|
143
|
+
|
138
144
|
```ruby
|
139
145
|
# config/initializers/rorvswild.rb
|
140
146
|
RorVsWild.start(
|
141
147
|
api_key: "API_KEY",
|
142
|
-
|
143
|
-
|
148
|
+
ignore_requests: ["SecretController#index"],
|
149
|
+
ignore_jobs: ["SecretJob"],
|
150
|
+
ignore_exceptions: ["ActionController::RoutingError", "ZeroDivisionError"],
|
151
|
+
ignore_plugins: ["Sidekiq"])
|
144
152
|
```
|
145
153
|
|
146
|
-
|
154
|
+
Finnally here is the list of all plugins that you can ignore :
|
155
|
+
|
156
|
+
- ActionController
|
157
|
+
- ActionMailer
|
158
|
+
- ActionView
|
159
|
+
- ActiveJob
|
160
|
+
- ActiveRecord
|
161
|
+
- DelayedJob
|
162
|
+
- Elasticsearch
|
163
|
+
- Mongo
|
164
|
+
- NetHttp
|
165
|
+
- Redis
|
166
|
+
- Resque
|
167
|
+
- Sidekiq
|
147
168
|
|
148
169
|
## Contributing
|
149
170
|
|
data/lib/rorvswild/agent.rb
CHANGED
@@ -8,7 +8,9 @@ module RorVsWild
|
|
8
8
|
{
|
9
9
|
api_url: "https://www.rorvswild.com/api/v1",
|
10
10
|
ignore_exceptions: default_ignored_exceptions,
|
11
|
-
|
11
|
+
ignore_requests: [],
|
12
|
+
ignore_plugins: [],
|
13
|
+
ignore_jobs: [],
|
12
14
|
}
|
13
15
|
end
|
14
16
|
|
@@ -37,21 +39,13 @@ module RorVsWild
|
|
37
39
|
end
|
38
40
|
|
39
41
|
def setup_plugins
|
40
|
-
Plugin
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
Plugin::Sidekiq.setup
|
48
|
-
Plugin::ActiveJob.setup
|
49
|
-
Plugin::DelayedJob.setup
|
50
|
-
|
51
|
-
Plugin::ActionView.setup
|
52
|
-
Plugin::ActiveRecord.setup
|
53
|
-
Plugin::ActionMailer.setup
|
54
|
-
Plugin::ActionController.setup
|
42
|
+
for name in RorVsWild::Plugin.constants
|
43
|
+
next if config[:ignore_plugins] && config[:ignore_plugins].include?(name.to_s)
|
44
|
+
if (plugin = RorVsWild::Plugin.const_get(name)).respond_to?(:setup)
|
45
|
+
RorVsWild.logger.info("Load plugin #{name}")
|
46
|
+
plugin.setup
|
47
|
+
end
|
48
|
+
end
|
55
49
|
end
|
56
50
|
|
57
51
|
def measure_code(code)
|
@@ -77,7 +71,8 @@ module RorVsWild
|
|
77
71
|
end
|
78
72
|
|
79
73
|
def measure_job(name, parameters: nil, &block)
|
80
|
-
return block
|
74
|
+
return measure_section(name, &block) if data[:name] # For recursive jobs
|
75
|
+
return block.call if ignored_job?(name)
|
81
76
|
initialize_data(name)
|
82
77
|
begin
|
83
78
|
block.call
|
@@ -135,8 +130,12 @@ module RorVsWild
|
|
135
130
|
end
|
136
131
|
end
|
137
132
|
|
138
|
-
def
|
139
|
-
config[:ignore_actions].include?(name)
|
133
|
+
def ignored_request?(name)
|
134
|
+
(config[:ignore_actions] || config[:ignore_requests]).include?(name)
|
135
|
+
end
|
136
|
+
|
137
|
+
def ignored_job?(name)
|
138
|
+
config[:ignore_jobs].include?(name)
|
140
139
|
end
|
141
140
|
|
142
141
|
#######################
|
data/lib/rorvswild/client.rb
CHANGED
data/lib/rorvswild/installer.rb
CHANGED
@@ -19,10 +19,25 @@ module RorVsWild
|
|
19
19
|
<<YAML
|
20
20
|
production:
|
21
21
|
api_key: #{api_key}
|
22
|
-
#
|
22
|
+
# ignore_requests: # Do not monitor the following actions
|
23
23
|
# - SecretController#index
|
24
|
-
#
|
25
|
-
# -
|
24
|
+
# ignore_jobs: # Do not monitor the following jobs
|
25
|
+
# - SecretJob
|
26
|
+
# ignore_exceptions: # Do not record the following exceptions
|
27
|
+
# - ActionController::RoutingError # By default to ignore 404
|
28
|
+
# ignore_plugins:
|
29
|
+
# - ActionController
|
30
|
+
# - ActionMailer
|
31
|
+
# - ActionView
|
32
|
+
# - ActiveJob
|
33
|
+
# - ActiveRecord
|
34
|
+
# - DelayedJob
|
35
|
+
# - Elasticsearch
|
36
|
+
# - Mongo
|
37
|
+
# - NetHttp
|
38
|
+
# - Redis
|
39
|
+
# - Resque
|
40
|
+
# - Sidekiq
|
26
41
|
YAML
|
27
42
|
end
|
28
43
|
end
|
@@ -35,7 +35,7 @@ module RorVsWild
|
|
35
35
|
|
36
36
|
# Payload: controller, action, params, format, method, path
|
37
37
|
def start(name, id, payload)
|
38
|
-
if !RorVsWild.agent.
|
38
|
+
if !RorVsWild.agent.ignored_request?(name = "#{payload[:controller]}##{payload[:action]}")
|
39
39
|
RorVsWild.agent.start_request(name: name, path: payload[:path])
|
40
40
|
end
|
41
41
|
end
|
data/lib/rorvswild/plugins.rb
CHANGED
@@ -1,15 +1 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require "rorvswild/plugin/redis"
|
4
|
-
require "rorvswild/plugin/mongo"
|
5
|
-
require "rorvswild/plugin/elasticsearch"
|
6
|
-
|
7
|
-
require "rorvswild/plugin/resque"
|
8
|
-
require "rorvswild/plugin/sidekiq"
|
9
|
-
require "rorvswild/plugin/active_job"
|
10
|
-
require "rorvswild/plugin/delayed_job"
|
11
|
-
|
12
|
-
require "rorvswild/plugin/action_view"
|
13
|
-
require "rorvswild/plugin/active_record"
|
14
|
-
require "rorvswild/plugin/action_mailer"
|
15
|
-
require "rorvswild/plugin/action_controller"
|
1
|
+
Dir[File.dirname(__FILE__) + "/plugin/*.rb"].each { |path| require path }
|
data/lib/rorvswild/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rorvswild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexis Bernard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Performances and quality insights for rails developers.
|
14
14
|
email:
|