stackify-ruby-apm 1.1.0 → 1.1.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: de9af597a0b5c2cd3404ca49bb58b493ceddf026
4
- data.tar.gz: dbfed2f61477f371a4e04d4e21e99774f85e3dba
3
+ metadata.gz: 9cdc4202c1c0062af195e5385b43fee272208e7e
4
+ data.tar.gz: 3983a54aee8710f485551e0f5c24fce5e940bbd9
5
5
  SHA512:
6
- metadata.gz: 2b1bae168fc9700f547c8de0ba4e26185c62b1e416d9b9520d7195db70977a6226cde6d47c07ab3ad1fa36fadeb3f2cdf685f3f006af8fedb6de93c210cd4fc7
7
- data.tar.gz: e9050031fcfcdf3449c9375837d41e8f157fb183c6882d063b7bbe879710998290eace9b3f3e847607328649b07026c3746e76c4188762f47d62034c28b75b4b
6
+ metadata.gz: 7ee08ddb0772686f93ba2546807762f2c780f7c15c2c039a41b09a3f3589f5bf3d180d3f8989de4922d16e8b802a0a7739025000062b925908eae30cb9ae1e01
7
+ data.tar.gz: 9ab46ee1da02e93377974ae4ab020a66b8a7b89069fee2f32d1e673dc4372397f5f784f86195c41220c7e06dc56004927739546f17eab1a6d912e7a7581bc659
data/Gemfile CHANGED
@@ -7,7 +7,7 @@ gemspec
7
7
 
8
8
  group :test do
9
9
  gem 'activerecord'
10
- gem 'curb'
10
+ gem 'curb', '0.9.8'
11
11
  gem 'fakeredis'
12
12
  gem 'http'
13
13
  gem 'httpclient'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stackify-ruby-apm (1.1.0)
4
+ stackify-ruby-apm (1.1.1)
5
5
  concurrent-ruby (~> 1.0)
6
6
  delegate_matcher (~> 0.4)
7
7
  rufus-scheduler (~> 3.5)
@@ -43,11 +43,11 @@ GEM
43
43
  minitest (~> 5.1)
44
44
  thread_safe (~> 0.3, >= 0.3.4)
45
45
  tzinfo (~> 1.1)
46
- addressable (2.5.2)
46
+ addressable (2.6.0)
47
47
  public_suffix (>= 2.0.2, < 4.0)
48
48
  arel (6.0.4)
49
49
  ast (2.4.0)
50
- bson (4.3.0)
50
+ bson (4.4.2)
51
51
  builder (3.2.3)
52
52
  concurrent-ruby (1.1.4)
53
53
  crack (0.4.3)
@@ -94,14 +94,14 @@ GEM
94
94
  mini_mime (1.0.1)
95
95
  mini_portile2 (2.1.0)
96
96
  minitest (5.11.3)
97
- mongo (2.6.2)
98
- bson (>= 4.3.0, < 5.0.0)
97
+ mongo (2.7.1)
98
+ bson (>= 4.4.2, < 5.0.0)
99
99
  multipart-post (2.0.0)
100
100
  mysql2 (0.5.2)
101
101
  nokogiri (1.6.8.1)
102
102
  mini_portile2 (~> 2.1.0)
103
- parallel (1.12.1)
104
- parser (2.5.3.0)
103
+ parallel (1.13.0)
104
+ parser (2.6.0.0)
105
105
  ast (~> 2.4.0)
106
106
  pg (0.21.0)
107
107
  powerpack (0.1.2)
@@ -170,8 +170,8 @@ GEM
170
170
  sexp_processor (~> 4.9)
171
171
  rufus-scheduler (3.5.2)
172
172
  fugit (~> 1.1, >= 1.1.5)
173
- safe_yaml (1.0.4)
174
- sequel (5.16.0)
173
+ safe_yaml (1.0.5)
174
+ sequel (5.18.0)
175
175
  sexp_processor (4.11.0)
176
176
  sinatra (1.4.8)
177
177
  rack (~> 1.5)
@@ -193,7 +193,7 @@ GEM
193
193
  activesupport (>= 4.0)
194
194
  sprockets (>= 3.0.0)
195
195
  sqlite3 (1.3.13)
196
- stackify-api-ruby (1.0.11)
196
+ stackify-api-ruby (1.0.13)
197
197
  faraday (~> 0.8)
198
198
  thor (0.20.3)
199
199
  thread_safe (0.3.6)
@@ -206,7 +206,7 @@ GEM
206
206
  unf (0.1.4)
207
207
  unf_ext
208
208
  unf_ext (0.0.7.5)
209
- unicode-display_width (1.4.1)
209
+ unicode-display_width (1.5.0)
210
210
  webmock (3.5.1)
211
211
  addressable (>= 2.3.6)
212
212
  crack (>= 0.3.2)
@@ -218,7 +218,7 @@ PLATFORMS
218
218
  DEPENDENCIES
219
219
  activerecord
220
220
  bundler (~> 1.16)
221
- curb
221
+ curb (= 0.9.8)
222
222
  fakeredis
223
223
  http
224
224
  httpclient
@@ -241,4 +241,4 @@ DEPENDENCIES
241
241
  webmock
242
242
 
243
243
  BUNDLED WITH
244
- 1.17.1
244
+ 1.17.3
@@ -93,10 +93,14 @@ module StackifyRubyAPM
93
93
  def start
94
94
  info '[Agent] start()'
95
95
  spies_name = ''
96
+ # If the rake task is detected as being ran then we don't load the spies
97
+ StackifyRubyAPM::Util.apm_disabled_in_rake
98
+ return false unless @config.instrument
96
99
  config.enabled_spies.each do |lib|
97
100
  spies_name = spies_name + ', ' + lib.inspect.to_s
98
101
  require "stackify_apm/spies/#{lib}"
99
102
  end
103
+
100
104
  debug '[Agent] Loaded spies:' + spies_name
101
105
  self
102
106
  end
@@ -122,6 +122,7 @@ module StackifyRubyAPM
122
122
 
123
123
  attr_reader :client_id
124
124
  attr_reader :device_id
125
+ attr_reader :apm_disabled_in_rake
125
126
 
126
127
  def app=(app)
127
128
  case app_type?(app)
@@ -16,10 +16,6 @@ module StackifyRubyAPM
16
16
  req = nil
17
17
  return request_without_apm(method, uri, *args, &block) unless StackifyRubyAPM.current_transaction
18
18
 
19
- # unless StackifyRubyAPM.current_transaction
20
- # return request_without_apm(method, uri, *args, &block)
21
- # end
22
-
23
19
  # Data configuration
24
20
  #
25
21
  method = method.upcase
@@ -8,7 +8,6 @@ module StackifyRubyAPM
8
8
  # @api private
9
9
  class MysqlAdapterSpy
10
10
  TYPE = 'db.sinatra_active_record.sql'.freeze
11
-
12
11
  if ActiveRecord::VERSION::MAJOR.to_i >= 5
13
12
  def install
14
13
  ActiveRecord::ConnectionAdapters::MySQL::DatabaseStatements.class_eval do
@@ -7,6 +7,15 @@ module StackifyRubyAPM
7
7
  def self.micros(target = Time.now.utc)
8
8
  target.to_i * 1_000_000 + target.usec
9
9
  end
10
+
11
+ #
12
+ # This method will check if there is any rake task is running.
13
+ # If rake task is detected we set instrument=false and don't load the spies.
14
+ #
15
+ def self.apm_disabled_in_rake
16
+ cmd_rake = ($PROGRAM_NAME =~ /rake$/)
17
+ StackifyRubyAPM.agent.config.instrument = false if cmd_rake
18
+ end
10
19
  end
11
20
  end
12
21
  require 'stackify_apm/util/inspector'
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Sets the version of the APM
4
4
  module StackifyRubyAPM
5
- VERSION = '1.1.0'.freeze
5
+ VERSION = '1.1.1'.freeze
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stackify-ruby-apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stackify
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-14 00:00:00.000000000 Z
11
+ date: 2019-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler