nunes 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/README.md +5 -1
- data/lib/nunes/subscribers/action_controller.rb +4 -0
- data/lib/nunes/version.rb +1 -1
- data/test/namespaced_controller_instrumentation_test.rb +21 -0
- data/test/rails_app/app/controllers/admin/posts_controller.rb +8 -0
- data/test/rails_app/config/routes.rb +1 -1
- metadata +2 -2
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -22,7 +22,7 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
nunes works out of the box with [instrumental app](http://instrumentalapp.com) (my
|
25
|
+
nunes works out of the box with [instrumental app](http://instrumentalapp.com) (my personal favorite) and [statsd](https://github.com/reinh/statsd). All you need to do is subscribe using an instance of statsd or instrumental's agent and you are good to go.
|
26
26
|
|
27
27
|
### With Instrumental
|
28
28
|
|
@@ -69,6 +69,8 @@ Based on those events, you'll get metrics like this in instrumental and statsd:
|
|
69
69
|
|
70
70
|
* `action_controller.status.200`
|
71
71
|
* `action_controller.format.html`
|
72
|
+
* `action_controller.controller.Admin.PostsController.new.status.403`
|
73
|
+
* `action_controller.controller.Admin.PostsController.index.format.json`
|
72
74
|
* `action_controller.exception.RuntimeError` - where RuntimeError is the class of any exceptions that occur while processing a controller's action.
|
73
75
|
* `active_support.cache.hit`
|
74
76
|
* `active_support.cache.miss`
|
@@ -81,6 +83,8 @@ Based on those events, you'll get metrics like this in instrumental and statsd:
|
|
81
83
|
* `action_controller.controller.PostsController.index.runtime.total`
|
82
84
|
* `action_controller.controller.PostsController.index.runtime.view`
|
83
85
|
* `action_controller.controller.PostsController.index.runtime.db`
|
86
|
+
* `action_controller.controller.PostsController.index.status.200`
|
87
|
+
* `action_controller.controller.PostsController.index.format.html`
|
84
88
|
* `action_view.template.app.views.posts.index.html.erb` - where `app.views.posts.index.html.erb` is the path of the view file
|
85
89
|
* `action_view.partial.app.views.posts._post.html.erb` - I can even do partials! woot woot!
|
86
90
|
* `action_mailer.deliver.PostMailer`
|
@@ -41,6 +41,10 @@ module Nunes
|
|
41
41
|
timing "#{namespace}.runtime.total", runtime
|
42
42
|
timing "#{namespace}.runtime.view", view_runtime if view_runtime
|
43
43
|
timing "#{namespace}.runtime.db", db_runtime if db_runtime
|
44
|
+
|
45
|
+
increment "#{namespace}.format.#{format}" if format
|
46
|
+
increment "#{namespace}.status.#{status}" if status
|
47
|
+
|
44
48
|
end
|
45
49
|
|
46
50
|
if exception_info
|
data/lib/nunes/version.rb
CHANGED
@@ -21,5 +21,26 @@ class NamespacedControllerInstrumentationTest < ActionController::TestCase
|
|
21
21
|
|
22
22
|
assert_timer "action_controller.controller.Admin.PostsController.index.runtime.total"
|
23
23
|
assert_timer "action_controller.controller.Admin.PostsController.index.runtime.view"
|
24
|
+
assert_timer "action_controller.controller.Admin.PostsController.index.runtime.db"
|
25
|
+
|
26
|
+
assert_counter "action_controller.format.html"
|
27
|
+
assert_counter "action_controller.status.200"
|
28
|
+
|
29
|
+
assert_counter "action_controller.controller.Admin.PostsController.index.format.html"
|
30
|
+
assert_counter "action_controller.controller.Admin.PostsController.index.status.200"
|
31
|
+
end
|
32
|
+
|
33
|
+
test "process_action w/ json" do
|
34
|
+
get :index, format: :json
|
35
|
+
|
36
|
+
assert_counter "action_controller.controller.Admin.PostsController.index.format.json"
|
37
|
+
end
|
38
|
+
|
39
|
+
test "process_action bad_request" do
|
40
|
+
get :new
|
41
|
+
|
42
|
+
assert_response :forbidden
|
43
|
+
|
44
|
+
assert_counter "action_controller.controller.Admin.PostsController.new.status.403"
|
24
45
|
end
|
25
46
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nunes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-10-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|