appsignal 1.1.6 → 1.1.7.beta.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: 6fe6d8912e2ec92a237d10feff184155f78e861f
4
- data.tar.gz: a8367402622454ee4e4fa5259e739362b1c9fafd
3
+ metadata.gz: 087f237fab88ce1726739ad3f08b7497e2e3f934
4
+ data.tar.gz: 3af658ab3c053d97e8913089069516304827d546
5
5
  SHA512:
6
- metadata.gz: 8975eba20b248f9c435df83f1d63609ccc1d60b82b97bdaa947cf2b53ed96fbb3a426fc7855dcfe73e2b093dd9267a980d49bab14e0210494c927c1c82632650
7
- data.tar.gz: fc9296f22d1fd6b4db880eb4bed5d03df9efbfb1f6c440909eb872e96916f8c3b9e8c82c90cda6cb428586ce2a914f222d7acd44b3c048d0c7d1ac0fed445c85
6
+ metadata.gz: c04140d7906580a8f06b8f2bbe9208264430b7c56ec283788ca8a27f6022a5be6cd8c2d386f0c6435f01d7cba68befc3ffc4ec422d5eb1184c552e0665b94804
7
+ data.tar.gz: 50b2e595b29ebc9014601a04073f082ff312412886335cc185919ea3b2ad1ca4714ca903feb98002e1360233c07957c5fbf50f7fa4f974756edbd71a9e462ea5
@@ -1,3 +1,7 @@
1
+ # 1.1.7
2
+ * Make logging resilient for closing FD's (daemons gem does this)
3
+ * Add support for using Resque through ActiveJob
4
+
1
5
  # 1.1.6
2
6
  * Generic Rack instrumentation middleware
3
7
  * Event formatter for Faraday
@@ -1,19 +1,19 @@
1
1
  ---
2
- version: '4201306'
2
+ version: f5c90a8
3
3
  triples:
4
4
  x86_64-linux:
5
- checksum: 29dc30be5de25655e2649f6f41266342483afca95a816d729da8be18c98341d7
6
- download_url: https://appsignal-agent-releases.global.ssl.fastly.net/4201306/appsignal-agent-x86_64-linux-static.tar.gz
5
+ checksum: c89f8fc1f321a50cadc6c47f404cc0995108ef31c02f7252328ab2c1e4ef23f4
6
+ download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f5c90a8/appsignal-agent-x86_64-linux-static.tar.gz
7
7
  lib_filename: libappsignal.a
8
8
  i686-linux:
9
- checksum: 4563916bd95f8d6942c15926583a3ee3979d71d2c606788dcb41369e6f495205
10
- download_url: https://appsignal-agent-releases.global.ssl.fastly.net/4201306/appsignal-agent-i686-linux-static.tar.gz
9
+ checksum: b9ea385e0c5ab6a7578fb9db9d31239aa9d153c1cf56024f68deb43ea5fa00a0
10
+ download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f5c90a8/appsignal-agent-i686-linux-static.tar.gz
11
11
  lib_filename: libappsignal.a
12
12
  x86-linux:
13
- checksum: 4563916bd95f8d6942c15926583a3ee3979d71d2c606788dcb41369e6f495205
14
- download_url: https://appsignal-agent-releases.global.ssl.fastly.net/4201306/appsignal-agent-i686-linux-static.tar.gz
13
+ checksum: b9ea385e0c5ab6a7578fb9db9d31239aa9d153c1cf56024f68deb43ea5fa00a0
14
+ download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f5c90a8/appsignal-agent-i686-linux-static.tar.gz
15
15
  lib_filename: libappsignal.a
16
16
  x86_64-darwin:
17
- checksum: 7ca9e9133d3c3876380ad1e682a8d0924c2857205cd4946012adf39dfd88a8bf
18
- download_url: https://appsignal-agent-releases.global.ssl.fastly.net/4201306/appsignal-agent-x86_64-darwin-static.tar.gz
17
+ checksum: 7fe3fba0bd65e1f3f95b0e5a3e8c08f5b79352aee84268eb9053da30c87d68d6
18
+ download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f5c90a8/appsignal-agent-x86_64-darwin-static.tar.gz
19
19
  lib_filename: libappsignal.a
@@ -1,5 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'resque'
4
+ gem 'rails', '~> 4.2.0'
5
+ gem 'mime-types', '~> 2.6'
4
6
 
5
7
  gemspec :path => '../'
@@ -264,6 +264,7 @@ require 'appsignal/marker'
264
264
  require 'appsignal/params_sanitizer'
265
265
  require 'appsignal/integrations/railtie' if defined?(::Rails)
266
266
  require 'appsignal/integrations/resque'
267
+ require 'appsignal/integrations/resque_active_job'
267
268
  require 'appsignal/subscriber'
268
269
  require 'appsignal/transaction'
269
270
  require 'appsignal/version'
@@ -0,0 +1,29 @@
1
+ module Appsignal
2
+ module Integrations
3
+ module ResqueActiveJobPlugin
4
+ include Appsignal::Hooks::Helpers
5
+
6
+ def self.included(base)
7
+ base.class_eval do
8
+
9
+ around_perform do |job, block|
10
+ Appsignal.monitor_single_transaction(
11
+ 'perform_job.resque',
12
+ :class => job.class.to_s,
13
+ :method => 'perform',
14
+ :params => job.format_args(job.arguments),
15
+ :metadata => {
16
+ :id => job.job_id,
17
+ :queue => job.queue_name
18
+ },
19
+ ) do
20
+ block.call
21
+ end
22
+ end
23
+
24
+ end
25
+ end
26
+
27
+ end
28
+ end
29
+ end
@@ -1,5 +1,5 @@
1
1
  require 'yaml'
2
2
 
3
3
  module Appsignal
4
- VERSION = '1.1.6'
4
+ VERSION = '1.1.7.beta.1'
5
5
  end
@@ -130,7 +130,7 @@ describe Appsignal::CLI::Install do
130
130
  end
131
131
 
132
132
  context "with sinatra" do
133
- if sinatra_present? && !padrino_present?
133
+ if sinatra_present? && !padrino_present? && !rails_present?
134
134
  describe ".install" do
135
135
  it "should install with environment variables" do
136
136
  cli.should_receive(:gets).once.and_return('Appname')
@@ -0,0 +1,40 @@
1
+ require 'spec_helper'
2
+
3
+ if resque_present? && active_job_present?
4
+ describe "Resque ActiveJob integration" do
5
+ let(:file) { File.expand_path('lib/appsignal/integrations/resque_active_job.rb') }
6
+
7
+ context "with Resque and ActiveJob" do
8
+ before do
9
+ load file
10
+ start_agent
11
+
12
+ class TestActiveJob < ActiveJob::Base
13
+ include Appsignal::Integrations::ResqueActiveJobPlugin
14
+
15
+ def perform(param)
16
+ end
17
+ end
18
+ end
19
+
20
+ describe :around_perform_plugin do
21
+ before { SecureRandom.stub(:uuid => 123) }
22
+ let(:job) { TestActiveJob.new('moo') }
23
+
24
+ it "should wrap in a transaction with the correct params" do
25
+ Appsignal.should_receive(:monitor_single_transaction).with(
26
+ 'perform_job.resque',
27
+ :class => 'TestActiveJob',
28
+ :method => 'perform',
29
+ :params => ['moo'],
30
+ :metadata => {
31
+ :id => 123,
32
+ :queue => 'default'
33
+ }
34
+ )
35
+ end
36
+ after { job.perform_now }
37
+ end
38
+ end
39
+ end
40
+ end
@@ -27,7 +27,7 @@ if resque_present?
27
27
 
28
28
  describe :around_perform_resque_plugin do
29
29
  let(:transaction) { Appsignal::Transaction.new('1', 'background', {}, {}) }
30
- let(:job) { Resque::Job.new('default', {'class' => 'TestJob'}) }
30
+ let(:job) { ::Resque::Job.new('default', {'class' => 'TestJob'}) }
31
31
  before do
32
32
  transaction.stub(:complete => true)
33
33
  Appsignal::Transaction.stub(:current => transaction)
@@ -55,7 +55,7 @@ if resque_present?
55
55
  end
56
56
 
57
57
  context "with exception" do
58
- let(:job) { Resque::Job.new('default', {'class' => 'BrokenTestJob'}) }
58
+ let(:job) { ::Resque::Job.new('default', {'class' => 'BrokenTestJob'}) }
59
59
 
60
60
  it "should set the exception" do
61
61
  Appsignal::Transaction.any_instance.should_receive(:set_error)
@@ -69,6 +69,15 @@ rescue LoadError
69
69
  false
70
70
  end
71
71
 
72
+ def active_job_present?
73
+ begin
74
+ require 'active_job'
75
+ true
76
+ rescue LoadError
77
+ false
78
+ end
79
+ end
80
+
72
81
  def sinatra_present?
73
82
  begin
74
83
  require 'sinatra'
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: 1.1.6
4
+ version: 1.1.7.beta.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Beekman
@@ -186,6 +186,7 @@ files:
186
186
  - lib/appsignal/integrations/railtie.rb
187
187
  - lib/appsignal/integrations/rake.rb
188
188
  - lib/appsignal/integrations/resque.rb
189
+ - lib/appsignal/integrations/resque_active_job.rb
189
190
  - lib/appsignal/integrations/sinatra.rb
190
191
  - lib/appsignal/js_exception_transaction.rb
191
192
  - lib/appsignal/marker.rb
@@ -244,6 +245,7 @@ files:
244
245
  - spec/lib/appsignal/integrations/mongo_ruby_driver_spec.rb
245
246
  - spec/lib/appsignal/integrations/padrino_spec.rb
246
247
  - spec/lib/appsignal/integrations/railtie_spec.rb
248
+ - spec/lib/appsignal/integrations/resque_active_job_spec.rb
247
249
  - spec/lib/appsignal/integrations/resque_spec.rb
248
250
  - spec/lib/appsignal/integrations/sinatra_spec.rb
249
251
  - spec/lib/appsignal/js_exception_transaction_spec.rb
@@ -295,9 +297,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
295
297
  version: '1.9'
296
298
  required_rubygems_version: !ruby/object:Gem::Requirement
297
299
  requirements:
298
- - - ">="
300
+ - - ">"
299
301
  - !ruby/object:Gem::Version
300
- version: '0'
302
+ version: 1.3.1
301
303
  requirements: []
302
304
  rubyforge_project:
303
305
  rubygems_version: 2.4.5
@@ -340,6 +342,7 @@ test_files:
340
342
  - spec/lib/appsignal/integrations/mongo_ruby_driver_spec.rb
341
343
  - spec/lib/appsignal/integrations/padrino_spec.rb
342
344
  - spec/lib/appsignal/integrations/railtie_spec.rb
345
+ - spec/lib/appsignal/integrations/resque_active_job_spec.rb
343
346
  - spec/lib/appsignal/integrations/resque_spec.rb
344
347
  - spec/lib/appsignal/integrations/sinatra_spec.rb
345
348
  - spec/lib/appsignal/js_exception_transaction_spec.rb