librato-rails 0.8.2 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +86 -0
- data/README.md +42 -0
- data/lib/librato/rails/version.rb +1 -1
- metadata +12 -55
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +0 -3102
- data/test/dummy/log/test.log +0 -10024
- data/test/dummy/tmp/cache/assets/CBF/9D0/sprockets%2F541895701c40c7d7fd678356b18cb59d +0 -0
- data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/CDF/870/sprockets%2Fb878faf942403e313a5b103e5d80488e +0 -0
- data/test/dummy/tmp/cache/assets/CE8/7E0/sprockets%2F178e2a1f9aa891d473009c7f3095df28 +0 -0
- data/test/dummy/tmp/cache/assets/CF9/7C0/sprockets%2F40fc2f3d2a468a00e463f1d313cb1683 +0 -0
- data/test/dummy/tmp/cache/assets/D02/220/sprockets%2F1410fa948b990522bdfeca7841d31b13 +0 -0
- data/test/dummy/tmp/cache/assets/D04/890/sprockets%2F587335c079eef8d5a63784fc8f99905a +0 -0
- data/test/dummy/tmp/cache/assets/D05/D40/sprockets%2F1c9faaf28d05409b88ad3113374d613c +0 -0
- data/test/dummy/tmp/cache/assets/D19/710/sprockets%2F5b878936d488c1f601c231fda1d678ea +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/D4F/000/sprockets%2F25e44896aac12384727e9dab827ebef9 +0 -0
- data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/D69/610/sprockets%2F3902e4b1ffbdb61222bf5fc45a44799a +0 -0
- data/test/dummy/tmp/cache/assets/D8B/F90/sprockets%2Ffe6ce696e9141eb755d8eed79128e17c +0 -0
- data/test/dummy/tmp/cache/assets/D98/8B0/sprockets%2Fedbef6e0d0a4742346cf479f2c522eb0 +0 -0
- data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
data/CHANGELOG.md
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
### Version 0.9.0
|
2
|
+
* Bump librato-metrics dependency version for new functionality
|
3
|
+
|
4
|
+
### Version 0.8.2
|
5
|
+
* Allow override of logging location (Rick Martinez)
|
6
|
+
|
7
|
+
### Version 0.8.1
|
8
|
+
* Bump librato-metrics to fix issue with Rails 3.1.6
|
9
|
+
|
10
|
+
### Version 0.8.0
|
11
|
+
* Add support for terser `LIBRATO_` prefixed environment variables
|
12
|
+
* Deprecate `LIBRATO_METRICS_` prefixed environment variables
|
13
|
+
* Always check worker, not just in forking servers
|
14
|
+
* Refactor configuration/logging functionality into standalone modules
|
15
|
+
|
16
|
+
### Version 0.7.3
|
17
|
+
* More resilient handling of invalid metric/source names
|
18
|
+
* Don't start if provided source is invalid
|
19
|
+
|
20
|
+
### Version 0.7.2
|
21
|
+
* Relax multi_json version requirement to allow running with Rails 3.1/3.0
|
22
|
+
* Fix exception if current environment is not in config file
|
23
|
+
* Always respect LIBRATO_METRICS_LOG_LEVEL env variable for easier startup debugging
|
24
|
+
* Add more debugging statements in startup sequence
|
25
|
+
|
26
|
+
### Version 0.7.1
|
27
|
+
* Support for Passenger 4 (James Miller)
|
28
|
+
|
29
|
+
### Version 0.7.0
|
30
|
+
* Add configurable log_level for easier debugging
|
31
|
+
* Show settings during startup in debug mode
|
32
|
+
* Logs are now redirected to be visible when running on Heroku
|
33
|
+
* Fix running with unicorn on Heroku
|
34
|
+
* Don't start on Heroku without an explicit source being set
|
35
|
+
* Improve log messages
|
36
|
+
* Clean up tracing output for measurements
|
37
|
+
* Remove redundant per-measurement time tracking
|
38
|
+
* Add some initial benchmarks of instrumenting performance
|
39
|
+
* Added troubleshooting and heroku setup sections to README
|
40
|
+
* Documentation improvements
|
41
|
+
|
42
|
+
### Version 0.6.0
|
43
|
+
* Add support for custom sources per measurement via increment
|
44
|
+
* Add support for custom sources per measurement via measure/timing
|
45
|
+
* Add support for sporadic (non-continuous) increment metrics
|
46
|
+
* Aggregate metrics by source by default
|
47
|
+
* Don't append pids to sources by default anymore
|
48
|
+
* Start extracting collector behaviors into Collector
|
49
|
+
* measure/timing metrics prefix now updates dynamically if .prefix changes after startup
|
50
|
+
* Fix issue with some helpers not being found when running on unicorn
|
51
|
+
* Fix issue with sometimes attempting submission without full credentials
|
52
|
+
* Documentation improvements
|
53
|
+
|
54
|
+
### Version 0.5.2
|
55
|
+
* Fix bug where measure/timing events don't apply global prefix properly
|
56
|
+
* Fix bug where increment events could have missing values if not called
|
57
|
+
|
58
|
+
### Version 0.5.1
|
59
|
+
* Remove old helper libs which may cause load conflict for rails helpers
|
60
|
+
* Don't lock mutex during duration of timing blocks
|
61
|
+
|
62
|
+
### Version 0.5.0
|
63
|
+
* Support block form of timing
|
64
|
+
* Config option to disable pid inclusion in source (Chris Roby)
|
65
|
+
* Change prefix handling to be global for all reported metrics
|
66
|
+
* Fix misassignment of source to prefix
|
67
|
+
|
68
|
+
### Version 0.4.1
|
69
|
+
* Fix whitespace-before-params warning.
|
70
|
+
|
71
|
+
### Version 0.4.0
|
72
|
+
* Support ERB config file using env variables. (Justin Smestad)
|
73
|
+
* Precedence changed to favor YAML config (if present) over env vars.
|
74
|
+
Mirrors Heroku add-on model. (Justin Smestad)
|
75
|
+
* Report counters as gauge increments instead.
|
76
|
+
|
77
|
+
### Version 0.3.1
|
78
|
+
* Fix config file fields to match new env variables
|
79
|
+
|
80
|
+
### Version 0.3.0
|
81
|
+
* Rename to librato-rails
|
82
|
+
* Change env variables to LIBRATO_METRICS_USER and LIBRATO_METRICS_TOKEN
|
83
|
+
|
84
|
+
### Version 0.2.0
|
85
|
+
* Add rack middleware component (Pat Allan)
|
86
|
+
* Fix config file detection (Rafael Chacon)
|
data/README.md
CHANGED
@@ -165,6 +165,48 @@ end
|
|
165
165
|
|
166
166
|
Symbols can be used interchangably with strings for metric names.
|
167
167
|
|
168
|
+
## Use with ActiveSupport::Notifications
|
169
|
+
|
170
|
+
`librato-rails` and [ActiveSupport::Notifications](http://api.rubyonrails.org/classes/ActiveSupport/Notifications.html) work great together. In fact, many of the Rails metrics provided are produced by subscribing to the [instrumentation events](http://edgeguides.rubyonrails.org/active_support_instrumentation.html) built into Rails.
|
171
|
+
|
172
|
+
Assume you have a custom event:
|
173
|
+
|
174
|
+
```ruby
|
175
|
+
ActiveSupport::Notifications.instrument 'my.event', :user => user do
|
176
|
+
# do work..
|
177
|
+
end
|
178
|
+
```
|
179
|
+
|
180
|
+
Writing a subscriber to capture that event and its outcomes is easy:
|
181
|
+
|
182
|
+
```ruby
|
183
|
+
ActiveSupport::Notifications.subscribe 'my.event' do |*args|
|
184
|
+
event = ActiveSupport::Notifications::Event.new(*args)
|
185
|
+
user = event.payload[:user]
|
186
|
+
|
187
|
+
# track every time the event happens
|
188
|
+
Librato.increment 'my.event'
|
189
|
+
|
190
|
+
# track how long the event is taking
|
191
|
+
Librato.timing 'my.event.time', event.duration
|
192
|
+
|
193
|
+
# use payload data to do user-specific tracking
|
194
|
+
Librato.increment 'user.did.event', :source => user.id, :sporadic => true
|
195
|
+
|
196
|
+
# do conditional tracking
|
197
|
+
if user.feature_on?(:sample_group)
|
198
|
+
Librato.increment 'user.sample.event'
|
199
|
+
end
|
200
|
+
|
201
|
+
# track slow events
|
202
|
+
if event.duration >= 50.0
|
203
|
+
Librato.increment 'my.event.slow'
|
204
|
+
end
|
205
|
+
end
|
206
|
+
```
|
207
|
+
|
208
|
+
These are just a few examples. Combining `ActiveSupport::Notifications` instrumentation with Librato can be extremely powerful. As an added benefit, using the instrument/subscribers model allows you to isolate complex instrumentation code from your main application codebase.
|
209
|
+
|
168
210
|
## Custom Prefix
|
169
211
|
|
170
212
|
You can set an optional prefix to all metrics reported by `librato-rails` in your [configuration](https://github.com/librato/librato-rails/wiki/Configuration). This can be helpful for isolating test data or forcing different apps to use different metric names.
|
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.
|
4
|
+
version: 0.9.0
|
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-08-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
requirements:
|
35
35
|
- - ~>
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: 1.0
|
37
|
+
version: 1.1.0
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ~>
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 1.0
|
45
|
+
version: 1.1.0
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: sqlite3
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -64,17 +64,17 @@ dependencies:
|
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
65
65
|
none: false
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
69
|
+
version: 2.0.3
|
70
70
|
type: :development
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
|
-
- -
|
75
|
+
- - ~>
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
77
|
+
version: 2.0.3
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
79
|
name: minitest
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- LICENSE
|
119
119
|
- Rakefile
|
120
120
|
- README.md
|
121
|
+
- CHANGELOG.md
|
121
122
|
- test/dummy/app/assets/javascripts/application.js
|
122
123
|
- test/dummy/app/assets/javascripts/home.js
|
123
124
|
- test/dummy/app/assets/javascripts/status.js
|
@@ -155,12 +156,8 @@ files:
|
|
155
156
|
- test/dummy/config/routes.rb
|
156
157
|
- test/dummy/config/unicorn.rb
|
157
158
|
- test/dummy/config.ru
|
158
|
-
- test/dummy/db/development.sqlite3
|
159
159
|
- test/dummy/db/migrate/20120719231810_create_users.rb
|
160
160
|
- test/dummy/db/schema.rb
|
161
|
-
- test/dummy/db/test.sqlite3
|
162
|
-
- test/dummy/log/development.log
|
163
|
-
- test/dummy/log/test.log
|
164
161
|
- test/dummy/public/404.html
|
165
162
|
- test/dummy/public/422.html
|
166
163
|
- test/dummy/public/500.html
|
@@ -168,24 +165,6 @@ files:
|
|
168
165
|
- test/dummy/Rakefile
|
169
166
|
- test/dummy/README.rdoc
|
170
167
|
- test/dummy/script/rails
|
171
|
-
- test/dummy/tmp/cache/assets/CBF/9D0/sprockets%2F541895701c40c7d7fd678356b18cb59d
|
172
|
-
- test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
|
173
|
-
- test/dummy/tmp/cache/assets/CDF/870/sprockets%2Fb878faf942403e313a5b103e5d80488e
|
174
|
-
- test/dummy/tmp/cache/assets/CE8/7E0/sprockets%2F178e2a1f9aa891d473009c7f3095df28
|
175
|
-
- test/dummy/tmp/cache/assets/CF9/7C0/sprockets%2F40fc2f3d2a468a00e463f1d313cb1683
|
176
|
-
- test/dummy/tmp/cache/assets/D02/220/sprockets%2F1410fa948b990522bdfeca7841d31b13
|
177
|
-
- test/dummy/tmp/cache/assets/D04/890/sprockets%2F587335c079eef8d5a63784fc8f99905a
|
178
|
-
- test/dummy/tmp/cache/assets/D05/D40/sprockets%2F1c9faaf28d05409b88ad3113374d613c
|
179
|
-
- test/dummy/tmp/cache/assets/D19/710/sprockets%2F5b878936d488c1f601c231fda1d678ea
|
180
|
-
- test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
|
181
|
-
- test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655
|
182
|
-
- test/dummy/tmp/cache/assets/D4F/000/sprockets%2F25e44896aac12384727e9dab827ebef9
|
183
|
-
- test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6
|
184
|
-
- test/dummy/tmp/cache/assets/D69/610/sprockets%2F3902e4b1ffbdb61222bf5fc45a44799a
|
185
|
-
- test/dummy/tmp/cache/assets/D8B/F90/sprockets%2Ffe6ce696e9141eb755d8eed79128e17c
|
186
|
-
- test/dummy/tmp/cache/assets/D98/8B0/sprockets%2Fedbef6e0d0a4742346cf479f2c522eb0
|
187
|
-
- test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994
|
188
|
-
- test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
|
189
168
|
- test/fixtures/config/librato.yml
|
190
169
|
- test/fixtures/config/simple.yml
|
191
170
|
- test/integration/custom_test.rb
|
@@ -216,7 +195,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
216
195
|
version: '0'
|
217
196
|
segments:
|
218
197
|
- 0
|
219
|
-
hash:
|
198
|
+
hash: 928415932724141645
|
220
199
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
221
200
|
none: false
|
222
201
|
requirements:
|
@@ -225,10 +204,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
225
204
|
version: '0'
|
226
205
|
segments:
|
227
206
|
- 0
|
228
|
-
hash:
|
207
|
+
hash: 928415932724141645
|
229
208
|
requirements: []
|
230
209
|
rubyforge_project:
|
231
|
-
rubygems_version: 1.8.
|
210
|
+
rubygems_version: 1.8.23
|
232
211
|
signing_key:
|
233
212
|
specification_version: 3
|
234
213
|
summary: Use Librato Metrics with your Rails 3 app
|
@@ -270,12 +249,8 @@ test_files:
|
|
270
249
|
- test/dummy/config/routes.rb
|
271
250
|
- test/dummy/config/unicorn.rb
|
272
251
|
- test/dummy/config.ru
|
273
|
-
- test/dummy/db/development.sqlite3
|
274
252
|
- test/dummy/db/migrate/20120719231810_create_users.rb
|
275
253
|
- test/dummy/db/schema.rb
|
276
|
-
- test/dummy/db/test.sqlite3
|
277
|
-
- test/dummy/log/development.log
|
278
|
-
- test/dummy/log/test.log
|
279
254
|
- test/dummy/public/404.html
|
280
255
|
- test/dummy/public/422.html
|
281
256
|
- test/dummy/public/500.html
|
@@ -283,24 +258,6 @@ test_files:
|
|
283
258
|
- test/dummy/Rakefile
|
284
259
|
- test/dummy/README.rdoc
|
285
260
|
- test/dummy/script/rails
|
286
|
-
- test/dummy/tmp/cache/assets/CBF/9D0/sprockets%2F541895701c40c7d7fd678356b18cb59d
|
287
|
-
- test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
|
288
|
-
- test/dummy/tmp/cache/assets/CDF/870/sprockets%2Fb878faf942403e313a5b103e5d80488e
|
289
|
-
- test/dummy/tmp/cache/assets/CE8/7E0/sprockets%2F178e2a1f9aa891d473009c7f3095df28
|
290
|
-
- test/dummy/tmp/cache/assets/CF9/7C0/sprockets%2F40fc2f3d2a468a00e463f1d313cb1683
|
291
|
-
- test/dummy/tmp/cache/assets/D02/220/sprockets%2F1410fa948b990522bdfeca7841d31b13
|
292
|
-
- test/dummy/tmp/cache/assets/D04/890/sprockets%2F587335c079eef8d5a63784fc8f99905a
|
293
|
-
- test/dummy/tmp/cache/assets/D05/D40/sprockets%2F1c9faaf28d05409b88ad3113374d613c
|
294
|
-
- test/dummy/tmp/cache/assets/D19/710/sprockets%2F5b878936d488c1f601c231fda1d678ea
|
295
|
-
- test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
|
296
|
-
- test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655
|
297
|
-
- test/dummy/tmp/cache/assets/D4F/000/sprockets%2F25e44896aac12384727e9dab827ebef9
|
298
|
-
- test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6
|
299
|
-
- test/dummy/tmp/cache/assets/D69/610/sprockets%2F3902e4b1ffbdb61222bf5fc45a44799a
|
300
|
-
- test/dummy/tmp/cache/assets/D8B/F90/sprockets%2Ffe6ce696e9141eb755d8eed79128e17c
|
301
|
-
- test/dummy/tmp/cache/assets/D98/8B0/sprockets%2Fedbef6e0d0a4742346cf479f2c522eb0
|
302
|
-
- test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994
|
303
|
-
- test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
|
304
261
|
- test/fixtures/config/librato.yml
|
305
262
|
- test/fixtures/config/simple.yml
|
306
263
|
- test/integration/custom_test.rb
|
File without changes
|
data/test/dummy/db/test.sqlite3
DELETED
Binary file
|