librato-rails 2.0.0 → 2.1.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 55db9c1fad4108fc0c21eec0569f0e264daca37c
4
+ data.tar.gz: d0cd8c4afb7319c7dbab496b665147e1e7048e5a
5
+ SHA512:
6
+ metadata.gz: 19b3bd2bcd339272bddded9d3cd523189ef03611c87925f10f117c14b5c7b08cb20223f92fba1298dd916d487da39f81ee46ed71c6b48b5594d6bb24f6b3d836
7
+ data.tar.gz: ed6dd7530e46ee1efc49fd37d1f6ef538638b07cb13ac70c386f1effd5762784eb0c51904525b9b5d6ce06cdd0d4e538b2fd5339e8b067bcbe5c57f2a357b8b8
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,6 @@
1
+ ### Version 2.1.0
2
+ * Add Rails 5.0 support (#135)
3
+
1
4
  ### Version 2.0.0
2
5
  * Add support for tagged measurements (#123)
3
6
 
data/README.md CHANGED
@@ -3,12 +3,22 @@ librato-rails
3
3
 
4
4
  [![Gem Version](https://badge.fury.io/rb/librato-rails.png)](http://badge.fury.io/rb/librato-rails) [![Build Status](https://secure.travis-ci.org/librato/librato-rails.png?branch=master)](http://travis-ci.org/librato/librato-rails) [![Code Climate](https://codeclimate.com/github/librato/librato-rails.png)](https://codeclimate.com/github/librato/librato-rails)
5
5
 
6
+ ---
7
+
8
+ **NOTE:** Starting with version 2.0.0 librato-rails requires a Librato account that [supports tagged metrics](https://www.librato.com/docs/kb/faq/account_questions/tags_or_sources/). If your Librato account doesn't yet support tagged metrics please use the [1.x.x version](https://rubygems.org/gems/librato-rails/versions/1.4.2).
9
+
10
+ ---
11
+
6
12
  `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
13
 
8
14
  Rails versions 3.0 or greater are supported on Ruby 1.9.3 and above.
9
15
 
10
16
  Verified combinations of Ruby/Rails are available in our [build matrix](http://travis-ci.org/librato/librato-rails).
11
17
 
18
+ ## Upgrading
19
+
20
+ Upgrading from version 1.x to 2.x introduces breaking changes for legacy sources. Please contact [support@librato.com](mailto:support@librato.com) to migrate an existing Librato account.
21
+
12
22
  ## Quick Start
13
23
 
14
24
  > Note: If you have not yet enabled Rails on the [Librato integrations page](https://metrics.librato.com/integrations) within your account, do this first. This will automatically set up Rails and Rack Spaces, displaying many useful performance metrics.
@@ -378,4 +388,4 @@ If you are debugging setting up `librato-rails` locally you can set `flush_inter
378
388
 
379
389
  ## Copyright
380
390
 
381
- Copyright (c) 2012-2016 [Librato Inc.](http://librato.com) See LICENSE for details.
391
+ Copyright (c) 2012-2017 [Librato Inc.](http://librato.com) See LICENSE for details.
@@ -2,18 +2,25 @@ module Librato
2
2
  module Rails
3
3
  module Subscribers
4
4
 
5
- # ActionJob
5
+ # Active Job
6
6
 
7
7
  %w{enqueue_at enqueue perform_start perform}.each do |metric|
8
8
 
9
9
  ActiveSupport::Notifications.subscribe "#{metric}.active_job" do |*args|
10
10
 
11
11
  event = ActiveSupport::Notifications::Event.new(*args)
12
+
12
13
  tags = {
13
- adapter: event.payload[:adapter].to_s.demodulize.underscore,
14
+ adapter: event.payload[:adapter].class.to_s.demodulize.underscore,
14
15
  job: event.payload[:job].class.to_s.demodulize.underscore
15
16
  }
16
17
 
18
+ VersionSpecifier.supported(max: '4.2') do
19
+ # Active Support instrumentation payload for :adapter is already a class in Rails 4.2.
20
+ # It was changed to the QueueAdapter object processing the job in Rails 5.
21
+ tags[:adapter] = event.payload[:adapter].to_s.demodulize.underscore
22
+ end
23
+
17
24
  collector.group "rails.job" do |c|
18
25
  c.increment metric, tags: tags, inherit_tags: true
19
26
  c.timing "#{metric}.time", event.duration, tags: tags, inherit_tags: true
@@ -1,5 +1,5 @@
1
1
  module Librato
2
2
  module Rails
3
- VERSION = "2.0.0"
3
+ VERSION = "2.1.0"
4
4
  end
5
5
  end
@@ -1,5 +1,9 @@
1
1
  class CacheController < ApplicationController
2
- before_filter :instrument_caching
2
+ Librato::Rails::VersionSpecifier.supported(max: '4.1') do
3
+ # ActiveSupport::Cache.instrument= was deprecated in Rails 4.2.
4
+ # Instrumentation is now always on so you can safely stop using it.
5
+ before_filter :instrument_caching
6
+ end
3
7
  after_filter :clear_cache
4
8
 
5
9
  def read
@@ -63,5 +63,11 @@ module Dummy
63
63
  # set librato_rails prefix
64
64
  # config.librato_rails.prefix = 'dummy'
65
65
  config.librato_rails.flush_interval = 5
66
+
67
+ Librato::Rails::VersionSpecifier.supported(min: '5.0') do
68
+ # Default behavior for queue adapter was changed from :inline to :async in Rails 5.
69
+ # This encourages using a persistent queuing backend in production. In-process queuing will suffice for tests.
70
+ config.active_job.queue_adapter = :inline
71
+ end
66
72
  end
67
73
  end
@@ -1,4 +1,8 @@
1
1
  require 'test_helper'
2
+ Librato::Rails::VersionSpecifier.supported(min: '4.2') do
3
+ # Active Job framework was introduced in Rails 4.2.
4
+ require 'dummy_job'
5
+ end
2
6
 
3
7
  class JobTest < ActiveSupport::IntegrationCase
4
8
  Librato::Rails::VersionSpecifier.supported(min: '4.2') do
metadata CHANGED
@@ -1,137 +1,118 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: librato-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
5
- prerelease:
4
+ version: 2.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Matt Sanders
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain:
12
- - !binary |-
13
- LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURMakNDQWhhZ0F3SUJB
14
- Z0lCQURBTkJna3Foa2lHOXcwQkFRVUZBREE5TVEwd0N3WURWUVFEREFSeWRX
15
- SjUKTVJjd0ZRWUtDWkltaVpQeUxHUUJHUllIYkdsaWNtRjBiekVUTUJFR0Nn
16
- bVNKb21UOGl4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ZSlttOst+xrBw4KG0dYUp
22
+ 2UvEe8iCyqEMQ8fEZ7EXuP2WMVICutFbz8Pt4hIMq+OTnDX+mIfma7GvPaKAFwID
23
+ AQABozkwNzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQBSxu9Jj4VTrXTpLujPwk9Kzwp
24
+ 2jALBgNVHQ8EBAMCBLAwDQYJKoZIhvcNAQEFBQADggEBACvNsw1pGv72xp3LiDlZ
25
+ 0tphNP/85RcYyJMklslG3tIYblyo71xHW1UbK5ArUK6k0BN43MuDn3pqLJQttVmi
26
+ bUdA3yYi13GeSrrAMlr4nH8Yt/Bn/XpZGliouJUBwh1BjG6dSj1iuR4/9pt9/LtO
27
+ QTdIc+07qGspypT0Uh/w/BodEcGuAaZZFlkU9vottTe6wWNnM6hfRExiSIsr+oVe
28
+ s8s83ObshjuSzjOqS56IBtNlPEL+D6ghjZZLP3lS6l9p70Pcpcl+IcE4veqZmmKC
29
+ sGepgRclC6UbZh+yQ3alXVghM2qsonAwI/rTNmFJN9kQn6nP9+f1Uf/qZFNcjn4L
30
+ 9bg=
31
+ -----END CERTIFICATE-----
32
+ date: 2017-02-27 00:00:00.000000000 Z
40
33
  dependencies:
41
34
  - !ruby/object:Gem::Dependency
42
35
  name: railties
43
36
  requirement: !ruby/object:Gem::Requirement
44
- none: false
45
37
  requirements:
46
- - - ! '>='
38
+ - - ">="
47
39
  - !ruby/object:Gem::Version
48
40
  version: '3.0'
49
41
  type: :runtime
50
42
  prerelease: false
51
43
  version_requirements: !ruby/object:Gem::Requirement
52
- none: false
53
44
  requirements:
54
- - - ! '>='
45
+ - - ">="
55
46
  - !ruby/object:Gem::Version
56
47
  version: '3.0'
57
48
  - !ruby/object:Gem::Dependency
58
49
  name: activesupport
59
50
  requirement: !ruby/object:Gem::Requirement
60
- none: false
61
51
  requirements:
62
- - - ! '>='
52
+ - - ">="
63
53
  - !ruby/object:Gem::Version
64
54
  version: '3.0'
65
55
  type: :runtime
66
56
  prerelease: false
67
57
  version_requirements: !ruby/object:Gem::Requirement
68
- none: false
69
58
  requirements:
70
- - - ! '>='
59
+ - - ">="
71
60
  - !ruby/object:Gem::Version
72
61
  version: '3.0'
73
62
  - !ruby/object:Gem::Dependency
74
63
  name: librato-rack
75
64
  requirement: !ruby/object:Gem::Requirement
76
- none: false
77
65
  requirements:
78
- - - ~>
66
+ - - "~>"
79
67
  - !ruby/object:Gem::Version
80
68
  version: 2.0.0
81
69
  type: :runtime
82
70
  prerelease: false
83
71
  version_requirements: !ruby/object:Gem::Requirement
84
- none: false
85
72
  requirements:
86
- - - ~>
73
+ - - "~>"
87
74
  - !ruby/object:Gem::Version
88
75
  version: 2.0.0
89
76
  - !ruby/object:Gem::Dependency
90
77
  name: sqlite3
91
78
  requirement: !ruby/object:Gem::Requirement
92
- none: false
93
79
  requirements:
94
- - - ! '>='
80
+ - - ">="
95
81
  - !ruby/object:Gem::Version
96
82
  version: '1.3'
97
83
  type: :development
98
84
  prerelease: false
99
85
  version_requirements: !ruby/object:Gem::Requirement
100
- none: false
101
86
  requirements:
102
- - - ! '>='
87
+ - - ">="
103
88
  - !ruby/object:Gem::Version
104
89
  version: '1.3'
105
90
  - !ruby/object:Gem::Dependency
106
91
  name: capybara
107
92
  requirement: !ruby/object:Gem::Requirement
108
- none: false
109
93
  requirements:
110
- - - ~>
94
+ - - "~>"
111
95
  - !ruby/object:Gem::Version
112
96
  version: 2.0.3
113
97
  type: :development
114
98
  prerelease: false
115
99
  version_requirements: !ruby/object:Gem::Requirement
116
- none: false
117
100
  requirements:
118
- - - ~>
101
+ - - "~>"
119
102
  - !ruby/object:Gem::Version
120
103
  version: 2.0.3
121
104
  - !ruby/object:Gem::Dependency
122
105
  name: rails
123
106
  requirement: !ruby/object:Gem::Requirement
124
- none: false
125
107
  requirements:
126
- - - ! '>='
108
+ - - ">="
127
109
  - !ruby/object:Gem::Version
128
110
  version: '3.0'
129
111
  type: :development
130
112
  prerelease: false
131
113
  version_requirements: !ruby/object:Gem::Requirement
132
- none: false
133
114
  requirements:
134
- - - ! '>='
115
+ - - ">="
135
116
  - !ruby/object:Gem::Version
136
117
  version: '3.0'
137
118
  description: Report key app statistics to the Librato Metrics service and easily track
@@ -143,10 +124,18 @@ executables: []
143
124
  extensions: []
144
125
  extra_rdoc_files: []
145
126
  files:
127
+ - CHANGELOG.md
128
+ - FAQ.md
129
+ - LICENSE
130
+ - README.md
131
+ - Rakefile
132
+ - lib/librato-rails.rb
133
+ - lib/librato/rails.rb
146
134
  - lib/librato/rails/configuration.rb
147
- - lib/librato/rails/helpers/controller.rb
148
135
  - lib/librato/rails/helpers.rb
136
+ - lib/librato/rails/helpers/controller.rb
149
137
  - lib/librato/rails/railtie.rb
138
+ - lib/librato/rails/subscribers.rb
150
139
  - lib/librato/rails/subscribers/cache.rb
151
140
  - lib/librato/rails/subscribers/controller.rb
152
141
  - lib/librato/rails/subscribers/job.rb
@@ -155,17 +144,11 @@ files:
155
144
  - lib/librato/rails/subscribers/render.rb
156
145
  - lib/librato/rails/subscribers/sql.rb
157
146
  - lib/librato/rails/subscribers/status.rb
158
- - lib/librato/rails/subscribers.rb
159
147
  - lib/librato/rails/tracker.rb
160
148
  - lib/librato/rails/version.rb
161
149
  - lib/librato/rails/version_specifier.rb
162
- - lib/librato/rails.rb
163
- - lib/librato-rails.rb
164
- - LICENSE
165
- - Rakefile
166
- - README.md
167
- - CHANGELOG.md
168
- - FAQ.md
150
+ - test/dummy/README.rdoc
151
+ - test/dummy/Rakefile
169
152
  - test/dummy/app/assets/javascripts/application.js
170
153
  - test/dummy/app/assets/javascripts/home.js
171
154
  - test/dummy/app/assets/javascripts/status.js
@@ -195,6 +178,7 @@ files:
195
178
  - test/dummy/app/views/render/template.html.erb
196
179
  - test/dummy/app/views/status/code.html.erb
197
180
  - test/dummy/app/views/user_mailer/welcome_email.text.erb
181
+ - test/dummy/config.ru
198
182
  - test/dummy/config/application.rb
199
183
  - test/dummy/config/boot.rb
200
184
  - test/dummy/config/database.yml
@@ -212,7 +196,6 @@ files:
212
196
  - test/dummy/config/locales/en.yml
213
197
  - test/dummy/config/routes.rb
214
198
  - test/dummy/config/unicorn.rb
215
- - test/dummy/config.ru
216
199
  - test/dummy/db/migrate/20120719231810_create_users.rb
217
200
  - test/dummy/db/schema.rb
218
201
  - test/dummy/extras/dummy_job.rb
@@ -220,8 +203,6 @@ files:
220
203
  - test/dummy/public/422.html
221
204
  - test/dummy/public/500.html
222
205
  - test/dummy/public/favicon.ico
223
- - test/dummy/Rakefile
224
- - test/dummy/README.rdoc
225
206
  - test/dummy/script/rails
226
207
  - test/fixtures/config/empty.yml
227
208
  - test/fixtures/config/librato.yml
@@ -242,33 +223,26 @@ files:
242
223
  homepage: https://github.com/librato/librato-rails
243
224
  licenses:
244
225
  - BSD 3-clause
226
+ metadata: {}
245
227
  post_install_message:
246
228
  rdoc_options: []
247
229
  require_paths:
248
230
  - lib
249
231
  required_ruby_version: !ruby/object:Gem::Requirement
250
- none: false
251
232
  requirements:
252
- - - ! '>='
233
+ - - ">="
253
234
  - !ruby/object:Gem::Version
254
235
  version: '0'
255
- segments:
256
- - 0
257
- hash: 3419366380046188108
258
236
  required_rubygems_version: !ruby/object:Gem::Requirement
259
- none: false
260
237
  requirements:
261
- - - ! '>='
238
+ - - ">="
262
239
  - !ruby/object:Gem::Version
263
240
  version: '0'
264
- segments:
265
- - 0
266
- hash: 3419366380046188108
267
241
  requirements: []
268
242
  rubyforge_project:
269
- rubygems_version: 1.8.23.2
243
+ rubygems_version: 2.2.2
270
244
  signing_key:
271
- specification_version: 3
245
+ specification_version: 4
272
246
  summary: Use Librato Metrics with your Rails 3 app
273
247
  test_files:
274
248
  - test/dummy/app/assets/javascripts/application.js
metadata.gz.sig CHANGED
Binary file