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 CHANGED
@@ -3,7 +3,7 @@ gemspec
3
3
 
4
4
  gem "rails", "~> 3.2.12"
5
5
  gem "sqlite3-ruby", require: "sqlite3"
6
- gem "minitest"
6
+ gem "minitest", '~> 4.7', :platforms => :ruby_19
7
7
  gem "rake"
8
8
 
9
9
  group :watch do
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 person 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.
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
@@ -1,3 +1,3 @@
1
1
  module Nunes
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -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
@@ -7,5 +7,13 @@ class Admin::PostsController < ApplicationController
7
7
  Post.new('First'),
8
8
  Post.new('Second'),
9
9
  ]
10
+ respond_to do |format|
11
+ format.html { render }
12
+ format.json { render :json => @posts }
13
+ end
14
+ end
15
+
16
+ def new
17
+ head :forbidden
10
18
  end
11
19
  end
@@ -1,6 +1,6 @@
1
1
  RailsApp::Application.routes.draw do
2
2
  namespace :admin do
3
- resources :posts, only: :index
3
+ resources :posts, only: [:index, :new]
4
4
  end
5
5
 
6
6
  resources :posts, only: :index
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.0
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-04-25 00:00:00.000000000 Z
12
+ date: 2013-10-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler