app_monit_rails 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/app_monit/rails/config.rb +5 -1
- data/lib/app_monit/rails/subscriber.rb +3 -0
- data/lib/app_monit/rails/version.rb +1 -1
- data/spec/dummy/app/controllers/posts_controller.rb +4 -0
- data/spec/dummy/config/routes.rb +4 -1
- data/spec/features/trigger_events_spec.rb +3 -0
- 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: eb1724eff0a8a6db03cde1ea08f481e47cb239bc
|
4
|
+
data.tar.gz: 1bd0c496c14de1fcbf1a72e91e7a6977df01ff39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc972ac156d93b261f7d64875ad2e24b1e5427f85372fc1b2e239f750c20fa53c668fc5e3cf570fa6e7c0d748c2eb90e2d3f7356eb3bf56f2542cbd7ce02f18f
|
7
|
+
data.tar.gz: 3696cb54137a9fab27ba798f7ff13ba6dd1ad6100c54c9605b8dc0f75c31582b40060441306ea88de5c07f2ea51fe4f0a1bf2aeeb5f7045de18fb5d07c736e5f
|
data/Gemfile.lock
CHANGED
@@ -2,7 +2,7 @@ module AppMonit
|
|
2
2
|
module Rails
|
3
3
|
class Config
|
4
4
|
class << self
|
5
|
-
attr_writer :enabled
|
5
|
+
attr_writer :enabled, :name, :skipped_endpoints
|
6
6
|
|
7
7
|
def enabled?
|
8
8
|
@enabled.nil? ? ::Rails.env != "test" : @enabled
|
@@ -11,6 +11,10 @@ module AppMonit
|
|
11
11
|
def name
|
12
12
|
@name.nil? ? ::Rails.application.class.parent_name : @name
|
13
13
|
end
|
14
|
+
|
15
|
+
def skipped_endpoints
|
16
|
+
@skipped_endpoints ||= []
|
17
|
+
end
|
14
18
|
end
|
15
19
|
end
|
16
20
|
end
|
@@ -13,6 +13,9 @@ module AppMonit
|
|
13
13
|
|
14
14
|
payload = event.payload
|
15
15
|
endpoint = "#{payload[:controller]}##{payload[:action]}"
|
16
|
+
|
17
|
+
return if AppMonit::Rails::Config.skipped_endpoints.include?(endpoint)
|
18
|
+
|
16
19
|
minute = event.time.to_i - (event.time.to_i % 60)
|
17
20
|
|
18
21
|
if payload[:exception]
|
data/spec/dummy/config/routes.rb
CHANGED
@@ -5,6 +5,7 @@ feature 'Triggered events' do
|
|
5
5
|
AppMonit::Config.end_point = 'http://test.local'
|
6
6
|
AppMonit::Config.api_key = 'api_key'
|
7
7
|
AppMonit::Config.env = 'test'
|
8
|
+
AppMonit::Rails::Config.skipped_endpoints = %w(PostsController#skipped)
|
8
9
|
|
9
10
|
10.times do
|
10
11
|
visit '/posts/'
|
@@ -34,6 +35,8 @@ feature 'Triggered events' do
|
|
34
35
|
visit '/posts/with_exception'
|
35
36
|
}.to raise_error
|
36
37
|
|
38
|
+
visit '/posts/skipped'
|
39
|
+
|
37
40
|
@worker = AppMonit::Rails::Worker.instance
|
38
41
|
@worker.push(:flush)
|
39
42
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: app_monit_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Redmar Kerkhoff
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-11-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: app_monit
|