librato-rails 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +3 -0
- data/README.md +11 -4
- data/lib/librato/rails/subscribers/controller.rb +8 -7
- data/lib/librato/rails/version.rb +1 -1
- data/test/integration/instrument_action_test.rb +4 -3
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 152f49ff52bc46153e592778c2e200c1a27b7212
|
4
|
+
data.tar.gz: e13fd4c9094655017a4d768b743d8c1106c1af21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6999cb0ecb28909e940e07211a4cf846cc5f8adfab66018626088af150d7ba85b7fa4d9d0065a2c068c16498de50dfa4dc7ba248bf98ae62537bcef32e051d3
|
7
|
+
data.tar.gz: e516c899ebf1a8027f2d03989e14a95b03fc9abd7488770817315d37658434c4cc44abc646c6330cc7a6cb27f14296d8e4df50765f0fc07b219286e2fc79aeb5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
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
|
-
|
8
|
+
Rails versions 3.0 or greater are supported on Ruby 1.9.2 and above.
|
9
9
|
|
10
|
-
|
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
|
186
|
+
Once you instrument an action, `librato-rails` will start reporting a set of metrics specific to that action including:
|
187
187
|
|
188
|
-
|
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
|
-
|
60
|
-
collector.group
|
59
|
+
source = "#{controller}.#{action}.#{format}"
|
60
|
+
collector.group 'rails.action.request' do |r|
|
61
61
|
|
62
|
-
r.increment 'total'
|
63
|
-
r.
|
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
|
@@ -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
|
-
|
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
|
16
|
+
assert_equal 1, aggregate.fetch("#{base}.#{t}", source: source)[:count]
|
16
17
|
end
|
17
18
|
|
18
|
-
assert_equal 1, counters
|
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.
|
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-
|
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
|