appsignal 1.2.0 → 1.2.1.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 +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +5 -0
- data/README.md +1 -1
- data/Rakefile +1 -0
- data/ext/agent.yml +9 -9
- data/ext/appsignal_extension.c +7 -2
- data/gemfiles/sequel-435.gemfile +6 -0
- data/gemfiles/sequel.gemfile +1 -1
- data/lib/appsignal.rb +1 -1
- data/lib/appsignal/cli.rb +1 -1
- data/lib/appsignal/cli/install.rb +5 -5
- data/lib/appsignal/hooks/sequel.rb +24 -5
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/cli/install_spec.rb +4 -4
- data/spec/lib/appsignal/cli_spec.rb +1 -1
- data/spec/lib/appsignal/hooks/sequel_spec.rb +9 -4
- data/spec/spec_helper.rb +0 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 350007064e166fbb91f0ac4dd1a84d4ef0830c71
|
4
|
+
data.tar.gz: cac950f88072c96359cad08e06c348b73ea36d77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 320de9094dddc0782864706cbf8886e30d5e1a5e44a5a828645f19c16b7a18d78becb98c93b582c2d3d8e8678dfef19451ad331fb05664ab7d995f4ebf7ee8e1
|
7
|
+
data.tar.gz: e1354c1a4966f439a8220a0147d5d7545654fbaf8acd060ef1b40efc42255f6c80691653b82d92eb4cb7ff1626db1e657809e2f95a967175ada8021e15139d3a
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@ AppSignal agent
|
|
4
4
|
This gem collects error and performance data from your Rails
|
5
5
|
applications and sends it to [AppSignal](https://appsignal.com)
|
6
6
|
|
7
|
-
[](https://travis-ci.org/appsignal/appsignal)
|
7
|
+
[](https://travis-ci.org/appsignal/appsignal-ruby)
|
8
8
|
[](http://badge.fury.io/rb/appsignal)
|
9
9
|
[](https://codeclimate.com/github/appsignal/appsignal)
|
10
10
|
|
data/Rakefile
CHANGED
data/ext/agent.yml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
|
-
version:
|
2
|
+
version: 2dbe674
|
3
3
|
triples:
|
4
4
|
x86_64-linux:
|
5
|
-
checksum:
|
6
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
5
|
+
checksum: 1b6fc9edd036b7f36810430a95b78fded2b901fa7d5fb8d2de9677de7df3c106
|
6
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/2dbe674/appsignal-x86_64-linux-all-static.tar.gz
|
7
7
|
i686-linux:
|
8
|
-
checksum:
|
9
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
8
|
+
checksum: fccad1b6c1df87fe7ed3c001567f902a95a029006354db2f10c512dc5ce0c262
|
9
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/2dbe674/appsignal-i686-linux-all-static.tar.gz
|
10
10
|
x86-linux:
|
11
|
-
checksum:
|
12
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
11
|
+
checksum: fccad1b6c1df87fe7ed3c001567f902a95a029006354db2f10c512dc5ce0c262
|
12
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/2dbe674/appsignal-i686-linux-all-static.tar.gz
|
13
13
|
x86_64-darwin:
|
14
|
-
checksum:
|
15
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
14
|
+
checksum: 0129536474fdfd4db707f74de467796aeca5862ef1d792d4e9b3a8badae55156
|
15
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/2dbe674/appsignal-x86_64-darwin-all-static.tar.gz
|
data/ext/appsignal_extension.c
CHANGED
@@ -123,13 +123,18 @@ static VALUE set_transaction_action(VALUE self, VALUE action) {
|
|
123
123
|
|
124
124
|
static VALUE set_transaction_queue_start(VALUE self, VALUE queue_start) {
|
125
125
|
appsignal_transaction* transaction;
|
126
|
+
int queue_start_type;
|
127
|
+
|
128
|
+
queue_start_type = TYPE(queue_start);
|
129
|
+
if (queue_start_type != T_FIXNUM && queue_start_type != T_BIGNUM) {
|
130
|
+
rb_raise(rb_eTypeError, "queue_start should be a Fixnum or Bignum");
|
131
|
+
}
|
126
132
|
|
127
|
-
Check_Type(queue_start, T_FIXNUM);
|
128
133
|
Data_Get_Struct(self, appsignal_transaction, transaction);
|
129
134
|
|
130
135
|
appsignal_set_transaction_queue_start(
|
131
136
|
transaction,
|
132
|
-
|
137
|
+
NUM2LONG(queue_start)
|
133
138
|
);
|
134
139
|
return Qnil;
|
135
140
|
}
|
data/gemfiles/sequel.gemfile
CHANGED
data/lib/appsignal.rb
CHANGED
data/lib/appsignal/cli.rb
CHANGED
@@ -64,7 +64,7 @@ module Appsignal
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def install_for_rails(config)
|
67
|
-
require File.expand_path(File.join(
|
67
|
+
require File.expand_path(File.join(Dir.pwd, 'config/application.rb'))
|
68
68
|
|
69
69
|
puts 'Installing for Ruby on Rails'
|
70
70
|
|
@@ -187,7 +187,7 @@ module Appsignal
|
|
187
187
|
end
|
188
188
|
|
189
189
|
def configure(config, environments, name_overwritten)
|
190
|
-
deploy_rb_file = File.join(
|
190
|
+
deploy_rb_file = File.join(Dir.pwd, 'config/deploy.rb')
|
191
191
|
if File.exists?(deploy_rb_file) && (File.read(deploy_rb_file) =~ /require (\'|\").\/appsignal\/capistrano/).nil?
|
192
192
|
print 'Adding AppSignal integration to deploy.rb'
|
193
193
|
File.open(deploy_rb_file, 'a') do |f|
|
@@ -285,7 +285,7 @@ module Appsignal
|
|
285
285
|
|
286
286
|
def rails_environments
|
287
287
|
@environments ||= Dir.glob(
|
288
|
-
File.join(
|
288
|
+
File.join(Dir.pwd, 'config/environments/*.rb')
|
289
289
|
).map { |o| File.basename(o, ".rb") }.sort - EXCLUDED_ENVIRONMENTS
|
290
290
|
end
|
291
291
|
|
@@ -298,8 +298,8 @@ module Appsignal
|
|
298
298
|
|
299
299
|
config = template.result(OpenStruct.new(data).instance_eval { binding })
|
300
300
|
|
301
|
-
FileUtils.mkdir_p(File.join(
|
302
|
-
File.write(File.join(
|
301
|
+
FileUtils.mkdir_p(File.join(Dir.pwd, 'config'))
|
302
|
+
File.write(File.join(Dir.pwd, 'config/appsignal.yml'), config)
|
303
303
|
end
|
304
304
|
end
|
305
305
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Appsignal
|
2
2
|
class Hooks
|
3
|
-
module
|
3
|
+
module SequelLogExtension
|
4
4
|
# Add query instrumentation
|
5
5
|
def log_yield(sql, args = nil)
|
6
6
|
ActiveSupport::Notifications.instrument(
|
@@ -12,6 +12,18 @@ module Appsignal
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
+
module SequelLogConnectionExtension
|
16
|
+
# Add query instrumentation
|
17
|
+
def log_connection_yield(sql, conn, args = nil)
|
18
|
+
ActiveSupport::Notifications.instrument(
|
19
|
+
'sql.sequel',
|
20
|
+
:sql => sql
|
21
|
+
) do
|
22
|
+
yield
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
15
27
|
class SequelHook < Appsignal::Hooks::Hook
|
16
28
|
register :sequel
|
17
29
|
|
@@ -23,10 +35,17 @@ module Appsignal
|
|
23
35
|
|
24
36
|
def install
|
25
37
|
# Register the extension...
|
26
|
-
::Sequel::
|
27
|
-
|
28
|
-
|
29
|
-
|
38
|
+
if ::Sequel::MAJOR >= 4 && ::Sequel::MINOR >= 35
|
39
|
+
::Sequel::Database.register_extension(
|
40
|
+
:appsignal_integration,
|
41
|
+
Appsignal::Hooks::SequelLogConnectionExtension
|
42
|
+
)
|
43
|
+
else
|
44
|
+
::Sequel::Database.register_extension(
|
45
|
+
:appsignal_integration,
|
46
|
+
Appsignal::Hooks::SequelLogExtension
|
47
|
+
)
|
48
|
+
end
|
30
49
|
|
31
50
|
# ... and automatically add it to future instances.
|
32
51
|
::Sequel::Database.extension(:appsignal_integration)
|
data/lib/appsignal/version.rb
CHANGED
@@ -13,7 +13,7 @@ describe Appsignal::CLI::Install do
|
|
13
13
|
let(:auth_check) { double }
|
14
14
|
|
15
15
|
before do
|
16
|
-
|
16
|
+
Dir.stub(:pwd => project_fixture_path)
|
17
17
|
@original_stdout = $stdout
|
18
18
|
$stdout = out_stream
|
19
19
|
Appsignal::AuthCheck.stub(:new => auth_check)
|
@@ -113,7 +113,7 @@ describe Appsignal::CLI::Install do
|
|
113
113
|
|
114
114
|
describe ".rails_environments" do
|
115
115
|
before do
|
116
|
-
|
116
|
+
Dir.stub(:pwd => project_fixture_path)
|
117
117
|
end
|
118
118
|
|
119
119
|
subject { cli.rails_environments }
|
@@ -379,7 +379,7 @@ describe Appsignal::CLI::Install do
|
|
379
379
|
let(:config_dir) { File.join(tmp_dir, 'config') }
|
380
380
|
let(:deploy_rb_file) { File.join(tmp_dir, 'config/deploy.rb') }
|
381
381
|
before do
|
382
|
-
|
382
|
+
Dir.stub(:pwd => tmp_dir)
|
383
383
|
FileUtils.mkdir_p(config_dir)
|
384
384
|
FileUtils.touch(deploy_rb_file)
|
385
385
|
cli.should_receive(:gets).once.and_return('2')
|
@@ -423,7 +423,7 @@ describe Appsignal::CLI::Install do
|
|
423
423
|
|
424
424
|
context ".write_config_file" do
|
425
425
|
before do
|
426
|
-
|
426
|
+
Dir.stub(:pwd => tmp_dir)
|
427
427
|
end
|
428
428
|
|
429
429
|
it "should write a config file with environments" do
|
@@ -1,16 +1,17 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe Appsignal::Hooks::SequelHook, if: sequel_present? do
|
4
4
|
let(:db) { Sequel.sqlite }
|
5
5
|
|
6
|
-
before do
|
6
|
+
before :all do
|
7
7
|
start_agent
|
8
8
|
end
|
9
9
|
|
10
|
-
|
11
|
-
before { Appsignal::Transaction.create('uuid', Appsignal::Transaction::HTTP_REQUEST, 'test') }
|
10
|
+
its(:dependencies_present?) { should be_true }
|
12
11
|
|
12
|
+
context "with a transaction" do
|
13
13
|
it "should instrument queries" do
|
14
|
+
Appsignal::Transaction.create('uuid', Appsignal::Transaction::HTTP_REQUEST, 'test')
|
14
15
|
expect( Appsignal::Transaction.current ).to receive(:start_event)
|
15
16
|
.at_least(:once)
|
16
17
|
expect( Appsignal::Transaction.current ).to receive(:finish_event)
|
@@ -21,3 +22,7 @@ describe "Sequel integration", if: sequel_present? do
|
|
21
22
|
end
|
22
23
|
end
|
23
24
|
end
|
25
|
+
|
26
|
+
describe Appsignal::Hooks::SequelHook, unless: sequel_present? do
|
27
|
+
its(:dependencies_present?) { should be_false }
|
28
|
+
end
|
data/spec/spec_helper.rb
CHANGED
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.2.
|
4
|
+
version: 1.2.1.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-06-
|
12
|
+
date: 2016-06-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
@@ -144,6 +144,7 @@ files:
|
|
144
144
|
- gemfiles/rails-4.2.gemfile
|
145
145
|
- gemfiles/rails-5.0.gemfile
|
146
146
|
- gemfiles/resque.gemfile
|
147
|
+
- gemfiles/sequel-435.gemfile
|
147
148
|
- gemfiles/sequel.gemfile
|
148
149
|
- gemfiles/sinatra.gemfile
|
149
150
|
- lib/appsignal.rb
|
@@ -299,9 +300,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
299
300
|
version: '1.9'
|
300
301
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
301
302
|
requirements:
|
302
|
-
- - "
|
303
|
+
- - ">"
|
303
304
|
- !ruby/object:Gem::Version
|
304
|
-
version:
|
305
|
+
version: 1.3.1
|
305
306
|
requirements: []
|
306
307
|
rubyforge_project:
|
307
308
|
rubygems_version: 2.4.5
|