stackify-ruby-apm 1.14.5 → 1.14.6

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
  SHA256:
3
- metadata.gz: 81a16e2527e1237952803d7082cd0869b932e2af04dd3263490e5bd6538debbd
4
- data.tar.gz: 3df0659ad3e96984f67c9850e69f38c20fae65ced83948b2791a2a9fe63012af
3
+ metadata.gz: 207d50046b455753b802c84ef15314d336df3376b986e98f8fff5014aeed6370
4
+ data.tar.gz: bfc2a15d2d26c9aea7263945b6a0f10c02da58f6c1ed0dfb6ea13fc2adcd6c38
5
5
  SHA512:
6
- metadata.gz: d6a34b33a19b3a59c69fdfa105255b234a77b3be6b81a0bbdac68bc39bdc92eb327c33d236d49beb064dafe87b6f4e882df53fb29365b2152572f4d9cf7fdf08
7
- data.tar.gz: e05ee709696f67a2bb4c7780a2b762393f5be5507c3af5b327c825e500fd3a18786827f2ba2e8d98df8e926af6cc2d4a5dc79fd380f8392fdd8443e04a998c5c
6
+ metadata.gz: bc2621fd6efa921753d1db81649e7cbff2f26b35350798c82a01a2326752ba2db8e42ccd5de1730a69a9516a849b48943415b9160ffeaa0b70b5baea54f3cb9e
7
+ data.tar.gz: 7f6b9b487101dad81b0b29acfe7c1844d29a778ff48235a9180160c2724dd78a57a8d6eee515169a01e4e36f92156ee9f590aa2a88de4043f1c47de64666d061
@@ -14,8 +14,7 @@ module StackifyRubyAPM
14
14
 
15
15
  def initialize(*args)
16
16
  super(*args)
17
-
18
- @type = format('db.%s.sql', lookup_adapter || 'unknown').freeze
17
+ @type = nil
19
18
  end
20
19
 
21
20
  def normalize(_transaction, _name, payload)
@@ -25,6 +24,11 @@ module StackifyRubyAPM
25
24
  check_prepared_stmt(statement, payload)
26
25
  name = payload[:sql] || payload[:name] || 'Default'
27
26
  context = Span::Context.new(statement)
27
+
28
+ if (@type == nil)
29
+ @type = format('db.%s.sql', lookup_adapter || 'unknown').freeze
30
+ end
31
+
28
32
  [name, @type, context]
29
33
  end
30
34
 
@@ -41,6 +45,21 @@ module StackifyRubyAPM
41
45
  props
42
46
  end
43
47
 
48
+ # Ideally the application doesn't connect to the database during boot,
49
+ # but sometimes it does. In case it did, we want to empty out the
50
+ # connection pools so that a non-database-using process (e.g. a master
51
+ # process in a forking server model) doesn't retain a needless
52
+ # connection. If it was needed, the incremental cost of reestablishing
53
+ # this connection is trivial: the rest of the pool would need to be
54
+ # populated anyway.
55
+ #
56
+ # Reference: https://github.com/rails/rails/blob/main/activerecord/lib/active_record/railtie.rb#L253
57
+ #
58
+ # Miko: Considering we are getting the connection method, it is retrieving connection from the connection pool
59
+ # Connection Method: lib/active_record/connection_handling.rb#L264
60
+ # Retrieve Connection: lib/active_record/connection_handling.rb#L309
61
+ # Handler Retrieve Connection: lib/active_record/connection_adapters/abstract/connection_pool.rb#L1111
62
+
44
63
  def lookup_adapter
45
64
  ::ActiveRecord::Base.connection.adapter_name.downcase
46
65
  rescue StandardError => error
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Sets the version of the APM
4
4
  module StackifyRubyAPM
5
- VERSION = '1.14.5'.freeze
5
+ VERSION = '1.14.6'.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.14.5
4
+ version: 1.14.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stackify
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-01 00:00:00.000000000 Z
11
+ date: 2021-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails