appsignal 0.11.4 → 0.11.5
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 +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +3 -0
- data/Rakefile +1 -0
- data/gemfiles/sequel.gemfile +6 -0
- data/lib/appsignal.rb +1 -0
- data/lib/appsignal/integrations/sequel.rb +26 -0
- data/lib/appsignal/version.rb +1 -1
- data/lib/sequel/extensions/appsignal_integration.rb +3 -0
- data/spec/lib/appsignal/integrations/sequel_spec.rb +21 -0
- data/spec/lib/appsignal/rack/instrumentation_spec.rb +0 -1
- data/spec/spec_helper.rb +7 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28b9ade66f02b2901ab65933aa6eb993e32000ad
|
4
|
+
data.tar.gz: 1eb565d3a57c0a62c2e261728dcec8a38f55f141
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fe9c09d3c7cb5f2fef232220a1acdd45e09a1b1691a939eba00c00de6299b3cb58c78c6be531ae3bc99d2023bab35ffbc1445cc0d1d9c91acbd79290682fe0e
|
7
|
+
data.tar.gz: 2b166f952ea4f0428ff5e54a4aecb7f2835aa70c19dcfc2c9c315a78a6b694e52a3f1dc9f43e09ef50658c929fd0c063fc61e60f64379c6d5c53ff3616c80db7
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
data/lib/appsignal.rb
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
if defined?(::Sequel)
|
2
|
+
Appsignal.logger.info("Loading Sequel (#{ Sequel::VERSION }) integration")
|
3
|
+
|
4
|
+
module Appsignal
|
5
|
+
module Integrations
|
6
|
+
module Sequel
|
7
|
+
# Add query instrumentation
|
8
|
+
def log_yield(sql, args = nil)
|
9
|
+
name = 'sql.sequel'
|
10
|
+
payload = {:sql => sql, :args => args}
|
11
|
+
|
12
|
+
ActiveSupport::Notifications.instrument(name, payload) { yield }
|
13
|
+
end
|
14
|
+
end # Sequel
|
15
|
+
end # Integrations
|
16
|
+
end # Appsignal
|
17
|
+
|
18
|
+
# Register the extension...
|
19
|
+
Sequel::Database.register_extension(
|
20
|
+
:appsignal_integration,
|
21
|
+
Appsignal::Integrations::Sequel
|
22
|
+
)
|
23
|
+
|
24
|
+
# ... and automatically add it to future instances.
|
25
|
+
Sequel::Database.extension(:appsignal_integration)
|
26
|
+
end
|
data/lib/appsignal/version.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Sequel integration", if: sequel_present? do
|
4
|
+
let(:file) { File.expand_path('lib/appsignal/integrations/sequel.rb') }
|
5
|
+
let(:db) { Sequel.sqlite }
|
6
|
+
|
7
|
+
before do
|
8
|
+
load file
|
9
|
+
start_agent
|
10
|
+
end
|
11
|
+
|
12
|
+
context "with Sequel" do
|
13
|
+
before { Appsignal::Transaction.create('uuid', 'test') }
|
14
|
+
|
15
|
+
it "should instrument queries" do
|
16
|
+
expect { db['SELECT 1'].all }
|
17
|
+
.to change { Appsignal::Transaction.current.events.empty? }
|
18
|
+
.from(true).to(false)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -38,6 +38,13 @@ def capistrano3_present?
|
|
38
38
|
Gem.loaded_specs['capistrano'].version >= Gem::Version.new('3.0')
|
39
39
|
end
|
40
40
|
|
41
|
+
def sequel_present?
|
42
|
+
require 'sequel'
|
43
|
+
true
|
44
|
+
rescue LoadError
|
45
|
+
false
|
46
|
+
end
|
47
|
+
|
41
48
|
require 'appsignal'
|
42
49
|
|
43
50
|
Dir[File.expand_path(File.join(File.dirname(__FILE__), 'support/helpers','*.rb'))].each {|f| require f}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appsignal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Beekman
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2015-02-
|
15
|
+
date: 2015-02-13 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rack
|
@@ -140,6 +140,7 @@ files:
|
|
140
140
|
- gemfiles/rails-4.0.gemfile
|
141
141
|
- gemfiles/rails-4.1.gemfile
|
142
142
|
- gemfiles/rails-4.2.gemfile
|
143
|
+
- gemfiles/sequel.gemfile
|
143
144
|
- gemfiles/sinatra.gemfile
|
144
145
|
- lib/appsignal.rb
|
145
146
|
- lib/appsignal/agent.rb
|
@@ -164,6 +165,7 @@ files:
|
|
164
165
|
- lib/appsignal/integrations/passenger.rb
|
165
166
|
- lib/appsignal/integrations/rails.rb
|
166
167
|
- lib/appsignal/integrations/resque.rb
|
168
|
+
- lib/appsignal/integrations/sequel.rb
|
167
169
|
- lib/appsignal/integrations/sidekiq.rb
|
168
170
|
- lib/appsignal/integrations/sinatra.rb
|
169
171
|
- lib/appsignal/integrations/unicorn.rb
|
@@ -180,6 +182,7 @@ files:
|
|
180
182
|
- lib/generators/appsignal/USAGE
|
181
183
|
- lib/generators/appsignal/appsignal_generator.rb
|
182
184
|
- lib/generators/appsignal/templates/appsignal.yml
|
185
|
+
- lib/sequel/extensions/appsignal_integration.rb
|
183
186
|
- lib/vendor/active_support/notifications.rb
|
184
187
|
- lib/vendor/active_support/notifications/fanout.rb
|
185
188
|
- lib/vendor/active_support/notifications/instrumenter.rb
|
@@ -204,6 +207,7 @@ files:
|
|
204
207
|
- spec/lib/appsignal/integrations/passenger_spec.rb
|
205
208
|
- spec/lib/appsignal/integrations/rails_spec.rb
|
206
209
|
- spec/lib/appsignal/integrations/resque_spec.rb
|
210
|
+
- spec/lib/appsignal/integrations/sequel_spec.rb
|
207
211
|
- spec/lib/appsignal/integrations/sidekiq_spec.rb
|
208
212
|
- spec/lib/appsignal/integrations/sinatra_spec.rb
|
209
213
|
- spec/lib/appsignal/integrations/unicorn_spec.rb
|
@@ -273,6 +277,7 @@ test_files:
|
|
273
277
|
- spec/lib/appsignal/integrations/passenger_spec.rb
|
274
278
|
- spec/lib/appsignal/integrations/rails_spec.rb
|
275
279
|
- spec/lib/appsignal/integrations/resque_spec.rb
|
280
|
+
- spec/lib/appsignal/integrations/sequel_spec.rb
|
276
281
|
- spec/lib/appsignal/integrations/sidekiq_spec.rb
|
277
282
|
- spec/lib/appsignal/integrations/sinatra_spec.rb
|
278
283
|
- spec/lib/appsignal/integrations/unicorn_spec.rb
|