appsignal 1.1.4 → 1.1.5.beta.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7960630ace02b918e79bdf0f96f6ede375f55ca5
4
- data.tar.gz: cab86c9d17a56711d27f5381b5a2a3b94dd4c297
3
+ metadata.gz: cfdc08fdd42809a6cffc841c28a20596d2db3f3d
4
+ data.tar.gz: 9f892def0286d4b5cbcb247c31132cee44b69def
5
5
  SHA512:
6
- metadata.gz: 6035b7e1754f58813908c1249ab1a0c6e5714d1ef6554f138ab4287ac01ff1a7ccef40cf5c23c697058eee493c2bb79a9d83df07512e240f41b993b0e898fa86
7
- data.tar.gz: a659b1e90e25bfab546a70013a16b084fb12c364120d986dd6b0b8bff4039c73098fb1782d779eae870508ab8f6fe69757c7fb1c9f4fa6cb6aa903a0777284f4
6
+ metadata.gz: fed1598d4d05ec88e9eeb400eb53b94af578b3c0d7184ecb3213d1c517250f53b44fe3cee4ef63c1b9a2a8d509f66439f10ba8c2c089da7cdee84922493d70d7
7
+ data.tar.gz: 1ea337a28fbc4817b820aa0cd78d9767f9f8a1cf77dccaa1ffd56cb8a4106a880b0c8ef05c5ae7a49f877869597205a1da44f41e98ad60f1757a690826d6f518
@@ -1,3 +1,9 @@
1
+ # 1.1.5
2
+ * Support for null in sql sanitization
3
+ * Add require to deploy.rb if present on installation
4
+ * Warn when overwriting already existing transaction
5
+ * Support for x86-linux
6
+
1
7
  # 1.1.4
2
8
  * Better debug logging for agent issues
3
9
  * Fix for exception with nil messages
@@ -1,15 +1,19 @@
1
1
  ---
2
- version: 9cf5b1c
2
+ version: 1776f03
3
3
  triples:
4
4
  x86_64-linux:
5
- checksum: e98ae2281a1b27d623dbd48105d9953f4cfbaaa4df3a24c4b87a6c04978da650
6
- download_url: https://appsignal-agent-releases.global.ssl.fastly.net/9cf5b1c/appsignal-agent-x86_64-linux-static.tar.gz
5
+ checksum: e7762cef292e9449e4d86f833ee7a80651845c3847122b4d4d995fb171462697
6
+ download_url: https://appsignal-agent-releases.global.ssl.fastly.net/1776f03/appsignal-agent-x86_64-linux-static.tar.gz
7
7
  lib_filename: libappsignal.a
8
8
  i686-linux:
9
- checksum: a8532d937900c17ab7f262eaceb66cb97722a615135ba5d43d0c17433e5573c0
10
- download_url: https://appsignal-agent-releases.global.ssl.fastly.net/9cf5b1c/appsignal-agent-i686-linux-static.tar.gz
9
+ checksum: 0407af36bc2d417a6fa5533f75f442489b71c4df7dc744421e199b2949d57d1f
10
+ download_url: https://appsignal-agent-releases.global.ssl.fastly.net/1776f03/appsignal-agent-i686-linux-static.tar.gz
11
+ lib_filename: libappsignal.a
12
+ x86-linux:
13
+ checksum: 0407af36bc2d417a6fa5533f75f442489b71c4df7dc744421e199b2949d57d1f
14
+ download_url: https://appsignal-agent-releases.global.ssl.fastly.net/1776f03/appsignal-agent-i686-linux-static.tar.gz
11
15
  lib_filename: libappsignal.a
12
16
  x86_64-darwin:
13
- checksum: 7df7bbb218fe6f62e2d5e3b6919f1ae0aa8a37fa05912a027d0bced07ade8676
14
- download_url: https://appsignal-agent-releases.global.ssl.fastly.net/9cf5b1c/appsignal-agent-x86_64-darwin-static.tar.gz
17
+ checksum: 5438333a6402ca07a606387086e4206a7fd7b5d884a291ccf44f9dffd39bd7c3
18
+ download_url: https://appsignal-agent-releases.global.ssl.fastly.net/1776f03/appsignal-agent-x86_64-darwin-static.tar.gz
15
19
  lib_filename: libappsignal.a
@@ -187,6 +187,17 @@ module Appsignal
187
187
  end
188
188
 
189
189
  def configure(config, environments, name_overwritten)
190
+ deploy_rb_file = File.join(ENV['PWD'], 'config/deploy.rb')
191
+ if File.exists?(deploy_rb_file) && (File.read(deploy_rb_file) =~ /require (\'|\").\/appsignal\/capistrano/).nil?
192
+ print 'Adding AppSignal integration to deploy.rb'
193
+ File.open(deploy_rb_file, 'a') do |f|
194
+ f.write "\nrequire 'appsignal/capistrano'\n"
195
+ end
196
+ periods
197
+ puts
198
+ puts
199
+ end
200
+
190
201
  puts "How do you want to configure AppSignal?"
191
202
  puts " (1) a config file"
192
203
  puts " (2) environment variables"
@@ -17,7 +17,19 @@ module Appsignal
17
17
 
18
18
  class << self
19
19
  def create(id, namespace, request, options={})
20
- Thread.current[:appsignal_transaction] = Appsignal::Transaction.new(id, namespace, request, options)
20
+ # Check if we already have a running transaction
21
+ if Thread.current[:appsignal_transaction] != nil
22
+
23
+ # Log the issue and return the current transaction
24
+ Appsignal.logger.debug("Trying to start new transaction #{id} but #{current.transaction_id} is already running. Using #{current.transaction_id}")
25
+
26
+ # Return the current (running) transaction
27
+ current
28
+
29
+ # Otherwise, start a new transaction
30
+ else
31
+ Thread.current[:appsignal_transaction] = Appsignal::Transaction.new(id, namespace, request, options)
32
+ end
21
33
  end
22
34
 
23
35
  def current
@@ -1,5 +1,5 @@
1
1
  require 'yaml'
2
2
 
3
3
  module Appsignal
4
- VERSION = '1.1.4'
4
+ VERSION = '1.1.5.beta.1'
5
5
  end
@@ -374,6 +374,27 @@ describe Appsignal::CLI::Install do
374
374
  out_stream.string.should include("Config file written to config/appsignal.yml")
375
375
  end
376
376
  end
377
+
378
+ context "when deploy.rb is present" do
379
+ let(:config_dir) { File.join(tmp_dir, 'config') }
380
+ let(:deploy_rb_file) { File.join(tmp_dir, 'config/deploy.rb') }
381
+ before do
382
+ ENV['PWD'] = tmp_dir
383
+ FileUtils.mkdir_p(config_dir)
384
+ FileUtils.touch(deploy_rb_file)
385
+ cli.should_receive(:gets).once.and_return('2')
386
+ end
387
+ after do
388
+ FileUtils.rm_rf(config_dir)
389
+ end
390
+
391
+ it "should add a require to deploy.rb" do
392
+ cli.configure(config, [], false)
393
+
394
+ out_stream.string.should include 'Adding AppSignal integration to deploy.rb'
395
+ File.read(deploy_rb_file).should include "require 'appsignal/capistrano'"
396
+ end
397
+ end
377
398
  end
378
399
 
379
400
  describe ".done_notice" do
@@ -17,33 +17,56 @@ describe Appsignal::Transaction do
17
17
  let(:merged_env) { http_request_env_with_data(env) }
18
18
  let(:options) { {} }
19
19
  let(:request) { Rack::Request.new(merged_env) }
20
- let(:transaction) { Appsignal::Transaction.create('1', namespace, request, options) }
20
+ let(:transaction) { Appsignal::Transaction.new('1', namespace, request, options) }
21
21
 
22
22
  before { Timecop.freeze(time) }
23
23
  after { Timecop.return }
24
24
 
25
25
  context "class methods" do
26
26
  describe ".create" do
27
- subject { transaction }
28
27
 
29
28
  it "should add the transaction to thread local" do
30
29
  Appsignal::Extension.should_receive(:start_transaction).with('1', 'http_request')
31
- subject
32
- Thread.current[:appsignal_transaction].should == subject
30
+
31
+ created_transaction = Appsignal::Transaction.create('1', namespace, request, options)
32
+
33
+ Thread.current[:appsignal_transaction].should == created_transaction
33
34
  end
34
35
 
35
36
  it "should create a transaction" do
36
- subject.should be_a Appsignal::Transaction
37
- subject.transaction_id.should == '1'
38
- subject.namespace.should == 'http_request'
37
+ created_transaction = Appsignal::Transaction.create('1', namespace, request, options)
38
+
39
+ created_transaction.should be_a Appsignal::Transaction
40
+ created_transaction.transaction_id.should == '1'
41
+ created_transaction.namespace.should == 'http_request'
42
+ end
43
+
44
+ context "when a transaction is already running" do
45
+ let(:running_transaction) { double(:transaction_id => 2) }
46
+ before { Thread.current[:appsignal_transaction] = running_transaction }
47
+
48
+ it "should not create a new transaction" do
49
+ expect(
50
+ Appsignal::Transaction.create('1', namespace, request, options)
51
+ ).to eq(running_transaction)
52
+ end
53
+
54
+ it "should output a debug message" do
55
+ expect( Appsignal.logger ).to receive(:debug)
56
+ .with("Trying to start new transaction 1 but 2 is already running. Using 2")
57
+
58
+ Appsignal::Transaction.create('1', namespace, request, options)
59
+ end
39
60
  end
40
61
  end
41
62
 
42
63
  describe '.current' do
64
+ before { Thread.current[:appsignal_transaction] = transaction }
65
+
43
66
  subject { Appsignal::Transaction.current }
44
67
 
45
68
  context "if there is a transaction" do
46
- before { transaction }
69
+ before { Appsignal::Transaction.create('1', namespace, request, options) }
47
70
 
48
71
  it "should return the correct transaction" do
49
72
  should == transaction
@@ -128,6 +128,10 @@ RSpec.configure do |config|
128
128
  FileUtils.mkdir_p(tmp_dir)
129
129
  end
130
130
 
131
+ config.after do
132
+ Thread.current[:appsignal_transaction] = nil
133
+ end
134
+
131
135
  config.before do
132
136
  ENV['PWD'] = File.expand_path(File.join(File.dirname(__FILE__), '../'))
133
137
  ENV['RAILS_ENV'] = 'test'
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.4
4
+ version: 1.1.5.beta.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Beekman
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-04-11 00:00:00.000000000 Z
12
+ date: 2016-04-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
@@ -291,9 +291,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
291
291
  version: '1.9'
292
292
  required_rubygems_version: !ruby/object:Gem::Requirement
293
293
  requirements:
294
- - - ">="
294
+ - - ">"
295
295
  - !ruby/object:Gem::Version
296
- version: '0'
296
+ version: 1.3.1
297
297
  requirements: []
298
298
  rubyforge_project:
299
299
  rubygems_version: 2.4.5