librato-rails 0.11.0 → 0.11.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 481fc3dec85887b6db3aa6c70fea21292dbd0fb2
4
- data.tar.gz: 04a8dee235d4e3d60292fe55634f059ab4b30b84
3
+ metadata.gz: 152f49ff52bc46153e592778c2e200c1a27b7212
4
+ data.tar.gz: e13fd4c9094655017a4d768b743d8c1106c1af21
5
5
  SHA512:
6
- metadata.gz: 01a97257228233f3a73574c3560ec65e7ff2b4a7cb4d11fcbcbdfac1691c7ddae763da52ef5631e92f504741feb067c175a044995d82d6c8b2992ad6ad956b65
7
- data.tar.gz: ba49549876186a7ca0e80e95edc38d5a9994666a84be9cbc771215cb97f49e2c63dc7d2cf0e2eedbf2d284afdacefacb7f61a6297e0cd66f5edb22649e923479
6
+ metadata.gz: a6999cb0ecb28909e940e07211a4cf846cc5f8adfab66018626088af150d7ba85b7fa4d9d0065a2c068c16498de50dfa4dc7ba248bf98ae62537bcef32e051d3
7
+ data.tar.gz: e516c899ebf1a8027f2d03989e14a95b03fc9abd7488770817315d37658434c4cc44abc646c6330cc7a6cb27f14296d8e4df50765f0fc07b219286e2fc79aeb5
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ### Version 0.11.1
2
+ * Use controller/action as source for instrument_action metrics
3
+
1
4
  ### Version 0.11.0
2
5
  * Add instrument_action for profiling a specific controller action
3
6
 
data/README.md CHANGED
@@ -5,9 +5,9 @@ librato-rails
5
5
 
6
6
  `librato-rails` will report key statistics for your Rails app to [Librato](https://metrics.librato.com/) and allow you to easily track your own custom metrics. Metrics are delivered asynchronously behind the scenes so they won't affect performance of your requests.
7
7
 
8
- Currently Rails 3.0+ and Ruby 1.9.2+ are required.
8
+ Rails versions 3.0 or greater are supported on Ruby 1.9.2 and above.
9
9
 
10
- You may want to read the [notes on upgrading](https://github.com/librato/librato-rails/wiki/Alpha-Tester-Upgrade-Notes) if you were an alpha tester.
10
+ Verified combinations of Ruby/Rails are available in our [build matrix](http://travis-ci.org/librato/librato-rails).
11
11
 
12
12
  ## Quick Start
13
13
 
@@ -183,9 +183,16 @@ class CommentController < ApplicationController
183
183
  end
184
184
  ```
185
185
 
186
- Once you instrument an action, `librato-rails` will start reporting a set of metrics specific to that action including # of requests, total time used per request, and db and view time used per request.
186
+ Once you instrument an action, `librato-rails` will start reporting a set of metrics specific to that action including:
187
187
 
188
- Action instrumentation metrics are named following the format `rails.action.<controller>.<action>.<format>.*`.
188
+ * rails.action.request.total (# of requests)
189
+ * rails.action.request.slow (requests >= 200ms to produce)
190
+ * rails.action.request.exceptions
191
+ * rails.action.request.time (total time spent in action)
192
+ * rails.action.request.time.db (db interaction time)
193
+ * rails.action.request.time.view (view rendering time)
194
+
195
+ Each instrumented action will appear as a source for the `rails.action.*` metrics, for example `mycontroller.action.html`.
189
196
 
190
197
  IMPORTANT NOTE: Metrics from `instrument_action` take into account all time spent in the ActionController stack for that action, including before/after filters and any global processing. They are _not_ equivalent to using a `Librato.timing` block inside the method body.
191
198
 
@@ -56,17 +56,18 @@ module Librato
56
56
  end # end group
57
57
 
58
58
  if @watches && @watches.index("#{controller}##{action}")
59
- page_key = "#{controller}.#{action}.#{format}"
60
- collector.group "rails.action.#{page_key}" do |r|
59
+ source = "#{controller}.#{action}.#{format}"
60
+ collector.group 'rails.action.request' do |r|
61
61
 
62
- r.increment 'total'
63
- r.timing 'time', event.duration
62
+ r.increment 'total', source: source
63
+ r.increment 'slow', source: source if event.duration > 200.0
64
+ r.timing 'time', event.duration, source: source
64
65
 
65
66
  if exception
66
- r.increment 'exceptions'
67
+ r.increment 'exceptions', source: source
67
68
  else
68
- r.timing 'time.db', event.payload[:db_runtime] || 0
69
- r.timing 'time.view', event.payload[:view_runtime] || 0
69
+ r.timing 'time.db', event.payload[:db_runtime] || 0, source: source
70
+ r.timing 'time.view', event.payload[:view_runtime] || 0, source: source
70
71
  end
71
72
 
72
73
  end
@@ -1,5 +1,5 @@
1
1
  module Librato
2
2
  module Rails
3
- VERSION = "0.11.0"
3
+ VERSION = "0.11.1"
4
4
  end
5
5
  end
@@ -8,14 +8,15 @@ class InstrumentActionTest < ActiveSupport::IntegrationCase
8
8
  # puts aggregate.instance_variable_get(:@cache).queued.inspect
9
9
  # puts counters.instance_variable_get(:@cache).inspect
10
10
 
11
- base = 'rails.action.InstrumentActionController.inst.html'
11
+ source = 'InstrumentActionController.inst.html'
12
12
 
13
+ base = 'rails.action.request'
13
14
  timings = %w{time time.db time.view}
14
15
  timings.each do |t|
15
- assert_equal 1, aggregate["#{base}.#{t}"][:count]
16
+ assert_equal 1, aggregate.fetch("#{base}.#{t}", source: source)[:count]
16
17
  end
17
18
 
18
- assert_equal 1, counters["#{base}.total"]
19
+ assert_equal 1, counters.fetch("#{base}.total", source: source)
19
20
  end
20
21
 
21
22
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: librato-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Sanders
@@ -29,7 +29,7 @@ cert_chain:
29
29
  Kx1ncn07A+bJnKZ6henQAF1CH96ZcqcJH179S2tIiKDM8keeRIUOPC3WT0faok/2
30
30
  gA2ozdr851c/nA==
31
31
  -----END CERTIFICATE-----
32
- date: 2014-07-03 00:00:00.000000000 Z
32
+ date: 2014-07-09 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: railties
metadata.gz.sig CHANGED
Binary file