plain_apm 0.8.5 → 0.8.7

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: fece4d0df7f5b93fe2064804ce006fc243e316441336ffff57f3c4697b2fb7c5
4
- data.tar.gz: b64728db3a2377fb0bbe409d9f857ee831f9d0445252fecce8651469c803d8c2
3
+ metadata.gz: 166f1a5259c2358113a5d383baeb578e5b83c311e37986cc31bd41efaa422307
4
+ data.tar.gz: e24691b831f7272dc7cd86a4460587f230d51eba9ddeb3cf208d73cb8b76639b
5
5
  SHA512:
6
- metadata.gz: b75d4204a0260e5b2c7977adbdb490a4de634c0ee564038d86f4134fa064168ad904994dac0814000eedee0f8632b97cef120458752648341538368533b9c49b
7
- data.tar.gz: d3e7e1ad7175433a14c77871cada300e18b75004d76b48dc869b5560fcf2d3460e1926e73ff6e50447c3f882d752197d6af6f14a8557df853e3b818ea7d2345d
6
+ metadata.gz: 376174018b1fc9d072bc145b579b7300fdc4edde068fe600949233cbef22ad96ca708aeb6d0ce651810a42651d2535b8a4072adcd9b880d0420fe388b2c7ce61
7
+ data.tar.gz: 85af3e06b5498aefb062af05cba03feefa2ca6db1cfe9e8959c69e309f6769e6b7c64d335fad71358d09c1e0c0daf380c44be3fa9a473023c30a438caff2b043
@@ -15,6 +15,10 @@ module PlainApm
15
15
  instance.start
16
16
  end
17
17
 
18
+ def self.stop
19
+ instance.stop
20
+ end
21
+
18
22
  def collect(event)
19
23
  return unless @config.enabled
20
24
 
@@ -38,7 +42,17 @@ module PlainApm
38
42
  install_hooks
39
43
 
40
44
  # TODO: add a cleaner shutdown.
41
- at_exit { shutdown }
45
+ at_exit { stop }
46
+ end
47
+
48
+ def stop
49
+ return if @publisher.nil?
50
+
51
+ uninstall_hooks
52
+
53
+ @events << nil
54
+ @publisher.join
55
+ @publisher = nil
42
56
  end
43
57
 
44
58
  private
@@ -48,7 +62,15 @@ module PlainApm
48
62
  end
49
63
 
50
64
  def install_hooks
51
- [
65
+ hooks.each(&:install)
66
+ end
67
+
68
+ def uninstall_hooks
69
+ hooks.each(&:uninstall)
70
+ end
71
+
72
+ def hooks
73
+ @hooks ||= [
52
74
  Hooks::Deploy,
53
75
  Hooks::ActionMailer,
54
76
  Hooks::ActionPack,
@@ -58,14 +80,7 @@ module PlainApm
58
80
  Hooks::ActiveSupport,
59
81
  Hooks::ErrorReporter,
60
82
  Hooks::Manual
61
- ].map(&:new).each(&:install)
62
- end
63
-
64
- def shutdown
65
- return if @publisher.nil?
66
-
67
- @events << nil
68
- @publisher.join
83
+ ].map(&:new)
69
84
  end
70
85
 
71
86
  ##
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PlainApm
4
- VERSION = "0.8.5"
4
+ VERSION = "0.8.7"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plain_apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
4
+ version: 0.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - PlainAPM Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-01 00:00:00.000000000 Z
11
+ date: 2024-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest