appsignal 2.4.3 → 2.5.0.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +14 -5
  3. data/.rubocop_todo.yml +3 -0
  4. data/.travis.yml +3 -4
  5. data/CHANGELOG.md +3 -0
  6. data/Rakefile +21 -6
  7. data/appsignal.gemspec +12 -5
  8. data/ext/Rakefile +27 -0
  9. data/ext/agent.yml +52 -21
  10. data/ext/base.rb +79 -0
  11. data/ext/extconf.rb +5 -76
  12. data/gemfiles/sequel-435.gemfile +5 -1
  13. data/gemfiles/sequel.gemfile +5 -1
  14. data/lib/appsignal.rb +11 -6
  15. data/lib/appsignal/cli.rb +1 -2
  16. data/lib/appsignal/cli/install.rb +3 -3
  17. data/lib/appsignal/config.rb +56 -37
  18. data/lib/appsignal/extension.rb +28 -4
  19. data/lib/appsignal/extension/jruby.rb +460 -0
  20. data/lib/appsignal/hooks/sidekiq.rb +4 -4
  21. data/lib/appsignal/integrations/capistrano/appsignal.cap +7 -2
  22. data/lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb +8 -3
  23. data/lib/appsignal/system.rb +16 -1
  24. data/lib/appsignal/transaction.rb +2 -2
  25. data/lib/appsignal/utils.rb +3 -1
  26. data/lib/appsignal/version.rb +1 -3
  27. data/spec/.rubocop.yml +3 -0
  28. data/spec/lib/appsignal/capistrano2_spec.rb +55 -41
  29. data/spec/lib/appsignal/capistrano3_spec.rb +87 -61
  30. data/spec/lib/appsignal/cli/diagnose_spec.rb +3 -3
  31. data/spec/lib/appsignal/cli/notify_of_deploy_spec.rb +4 -4
  32. data/spec/lib/appsignal/config_spec.rb +54 -21
  33. data/spec/lib/appsignal/extension/jruby_spec.rb +43 -0
  34. data/spec/lib/appsignal/extension_spec.rb +28 -12
  35. data/spec/lib/appsignal/hooks/sequel_spec.rb +7 -1
  36. data/spec/lib/appsignal/integrations/que_spec.rb +5 -5
  37. data/spec/lib/appsignal/system_spec.rb +5 -4
  38. data/spec/lib/appsignal/transaction_spec.rb +8 -8
  39. data/spec/lib/appsignal/utils/params_sanitizer_spec.rb +4 -4
  40. data/spec/lib/appsignal/utils/query_params_sanitizer_spec.rb +3 -3
  41. data/spec/lib/appsignal_spec.rb +5 -3
  42. data/spec/spec_helper.rb +29 -8
  43. data/spec/support/helpers/config_helpers.rb +3 -2
  44. metadata +12 -7
@@ -43,7 +43,7 @@ describe Appsignal::Utils::QueryParamsSanitizer do
43
43
  end
44
44
 
45
45
  context "when value is an array" do
46
- let(:value) { %w(foo bar) }
46
+ let(:value) { %w[foo bar] }
47
47
 
48
48
  it "should only return the first level of the object" do
49
49
  expect(subject).to eq("?")
@@ -51,7 +51,7 @@ describe Appsignal::Utils::QueryParamsSanitizer do
51
51
 
52
52
  it "should not modify source value" do
53
53
  subject
54
- expect(value).to eq(%w(foo bar))
54
+ expect(value).to eq(%w[foo bar])
55
55
  end
56
56
  end
57
57
 
@@ -115,7 +115,7 @@ describe Appsignal::Utils::QueryParamsSanitizer do
115
115
  end
116
116
 
117
117
  context "when value is an array" do
118
- let(:value) { %w(foo bar) }
118
+ let(:value) { %w[foo bar] }
119
119
 
120
120
  it "should sanitize all hash values with a single questionmark" do
121
121
  expect(subject).to eq(["?"])
@@ -87,9 +87,11 @@ describe Appsignal do
87
87
  Appsignal.start
88
88
  end
89
89
 
90
- it "should install the allocation event hook" do
91
- expect(Appsignal::Extension).to receive(:install_allocation_event_hook)
92
- Appsignal.start
90
+ unless Appsignal::System.jruby?
91
+ it "installs the allocation event hook" do
92
+ expect(Appsignal::Extension).to receive(:install_allocation_event_hook)
93
+ Appsignal.start
94
+ end
93
95
  end
94
96
 
95
97
  it "should add the gc probe to minutely" do
@@ -32,15 +32,27 @@ if DependencyHelper.rails_present?
32
32
  end
33
33
  require "appsignal"
34
34
 
35
+ module Appsignal
36
+ class << self
37
+ remove_method :testing?
38
+
39
+ def testing?
40
+ true
41
+ end
42
+ end
43
+ end
44
+
35
45
  puts "Running specs in #{RUBY_VERSION} on #{RUBY_PLATFORM}\n\n"
36
46
 
37
47
  # Add way to clear subscribers between specs
38
- module ActiveSupport
39
- module Notifications
40
- class Fanout
41
- def clear_subscribers
42
- @subscribers.clear
43
- @listeners_for.clear
48
+ if defined?(ActiveSupport)
49
+ module ActiveSupport
50
+ module Notifications
51
+ class Fanout
52
+ def clear_subscribers
53
+ @subscribers.clear
54
+ @listeners_for.clear
55
+ end
44
56
  end
45
57
  end
46
58
  end
@@ -75,9 +87,18 @@ RSpec.configure do |config|
75
87
  ENV["PADRINO_ENV"] ||= "test"
76
88
 
77
89
  # Clean environment
78
- appsignal_key_prefixes = %w(APPSIGNAL_ _APPSIGNAL_)
90
+ appsignal_key_prefixes = %w[APPSIGNAL_ _APPSIGNAL_]
79
91
  env_keys = ENV.keys.select { |key| key.start_with?(*appsignal_key_prefixes) }
80
- env_keys.each { |key| ENV.delete(key) }
92
+ env_keys.each do |key|
93
+ # First set the ENV var to an empty string and then delete the key from
94
+ # the env. We set the env var to an empty string first as jRuby doesn't
95
+ # sync `delete` calls to extensions, making our extension think the env
96
+ # var is still set after calling `ENV.delete`. Setting it to an empty
97
+ # string will sort of unset it, our extension ignores env vars with an
98
+ # empty string as a value.
99
+ ENV[key] = ""
100
+ ENV.delete(key)
101
+ end
81
102
 
82
103
  # Stub system_tmp_dir to something in the project dir for specs
83
104
  allow(Appsignal::Config).to receive(:system_tmp_dir).and_return(spec_system_tmp_dir)
@@ -5,11 +5,12 @@ module ConfigHelpers
5
5
  )
6
6
  end
7
7
 
8
- def project_fixture_config(env = "production", initial_config = {})
8
+ def project_fixture_config(env = "production", initial_config = {}, logger = Appsignal.logger)
9
9
  Appsignal::Config.new(
10
10
  project_fixture_path,
11
11
  env,
12
- initial_config
12
+ initial_config,
13
+ logger
13
14
  )
14
15
  end
15
16
 
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: 2.4.3
4
+ version: 2.5.0.alpha.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: 2017-11-28 00:00:00.000000000 Z
12
+ date: 2017-12-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
@@ -101,14 +101,14 @@ dependencies:
101
101
  requirements:
102
102
  - - '='
103
103
  - !ruby/object:Gem::Version
104
- version: 0.46.0
104
+ version: 0.49.0
105
105
  type: :development
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - '='
110
110
  - !ruby/object:Gem::Version
111
- version: 0.46.0
111
+ version: 0.49.0
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: yard
114
114
  requirement: !ruby/object:Gem::Requirement
@@ -146,8 +146,10 @@ files:
146
146
  - appsignal.gemspec
147
147
  - benchmark.rake
148
148
  - bin/appsignal
149
+ - ext/Rakefile
149
150
  - ext/agent.yml
150
151
  - ext/appsignal_extension.c
152
+ - ext/base.rb
151
153
  - ext/extconf.rb
152
154
  - gemfiles/capistrano2.gemfile
153
155
  - gemfiles/capistrano3.gemfile
@@ -186,6 +188,7 @@ files:
186
188
  - lib/appsignal/event_formatter/mongo_ruby_driver/query_formatter.rb
187
189
  - lib/appsignal/event_formatter/moped/query_formatter.rb
188
190
  - lib/appsignal/extension.rb
191
+ - lib/appsignal/extension/jruby.rb
189
192
  - lib/appsignal/garbage_collection_profiler.rb
190
193
  - lib/appsignal/hooks.rb
191
194
  - lib/appsignal/hooks/action_cable.rb
@@ -258,6 +261,7 @@ files:
258
261
  - spec/lib/appsignal/event_formatter/mongo_ruby_driver/query_formatter_spec.rb
259
262
  - spec/lib/appsignal/event_formatter/moped/query_formatter_spec.rb
260
263
  - spec/lib/appsignal/event_formatter_spec.rb
264
+ - spec/lib/appsignal/extension/jruby_spec.rb
261
265
  - spec/lib/appsignal/extension_spec.rb
262
266
  - spec/lib/appsignal/garbage_collection_profiler_spec.rb
263
267
  - spec/lib/appsignal/hooks/action_cable_spec.rb
@@ -337,7 +341,7 @@ files:
337
341
  - spec/support/rails/my_app.rb
338
342
  - spec/support/shared_examples/instrument.rb
339
343
  - spec/support/stubs/delayed_job.rb
340
- homepage: https://github.com/appsignal/appsignal
344
+ homepage: https://github.com/appsignal/appsignal-ruby
341
345
  licenses:
342
346
  - MIT
343
347
  metadata: {}
@@ -353,9 +357,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
353
357
  version: '1.9'
354
358
  required_rubygems_version: !ruby/object:Gem::Requirement
355
359
  requirements:
356
- - - ">="
360
+ - - ">"
357
361
  - !ruby/object:Gem::Version
358
- version: '0'
362
+ version: 1.3.1
359
363
  requirements: []
360
364
  rubyforge_project:
361
365
  rubygems_version: 2.7.2
@@ -383,6 +387,7 @@ test_files:
383
387
  - spec/lib/appsignal/event_formatter/mongo_ruby_driver/query_formatter_spec.rb
384
388
  - spec/lib/appsignal/event_formatter/moped/query_formatter_spec.rb
385
389
  - spec/lib/appsignal/event_formatter_spec.rb
390
+ - spec/lib/appsignal/extension/jruby_spec.rb
386
391
  - spec/lib/appsignal/extension_spec.rb
387
392
  - spec/lib/appsignal/garbage_collection_profiler_spec.rb
388
393
  - spec/lib/appsignal/hooks/action_cable_spec.rb