appsignal 2.9.6-java → 2.9.7-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92a3e8d10cd1fdf02f0ba5fc2083cc3524a3f3b3882e1e1686df719ca1280473
4
- data.tar.gz: 8a92cc47146720f2ba0bd8be84190577b9717c8f6d0ee39cfe28727efb59de9d
3
+ metadata.gz: 1191a88284d057b5c51ac3c2b7eb60d3a89718b916669c0036b7d837773f752b
4
+ data.tar.gz: d957119f4ebb9f0a2d2ba015880a3a7d6be93ef33a26a9a7b3e7430ce6718027
5
5
  SHA512:
6
- metadata.gz: f20caec585b2f0eb8c705cfd3d6c9ac26e44840a42d960f642d6b268f374f1ebd16f672c2d5d54343e65b4ec43b0e525416662fda735168d6297f50484460e2a
7
- data.tar.gz: fc1859e2c96b8a36fc4aef021f5702e1082d54866817a1f234b0f080f843f7cfa7df5abd923fa1fbe60507522b0a600f165a7d7e0bc9297921f596378590a818
6
+ metadata.gz: 9b3e5a0947a8ffd0130a975843913fa232e20c2874d4f0153cba370db27995b7d41cae025ff2ec271bd378cadeab86dbf57e49543f446c8fac07a53a3c618930
7
+ data.tar.gz: c8bf4f9b49cca25cdc6c7f02d36e74cd6a10c6b9ad4614a4f6c25409ba03c4069fe1bff7eb1f3c3580a069fffb936ac8dfe39da29efd0caab50bf4f3b106a48a
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.9.7
4
+ - Fix minutely probes not being loaded from Rails initializers. PR #528
5
+
3
6
  ## 2.9.6
4
7
  - Print link to diagnose docs on unsuccessful demo command. PR #512
5
8
  - Add support for minutely probe `.dependencies_present?` check. PR #523
@@ -6,12 +6,14 @@ module Appsignal
6
6
  passwd_struct = Etc.getpwuid(uid)
7
7
  return unless passwd_struct
8
8
  passwd_struct.name
9
+ rescue ArgumentError # rubocop:disable Lint/HandleExceptions
9
10
  end
10
11
 
11
12
  def self.group_for_gid(gid)
12
13
  passwd_struct = Etc.getgrgid(gid)
13
14
  return unless passwd_struct
14
15
  passwd_struct.name
16
+ rescue ArgumentError # rubocop:disable Lint/HandleExceptions
15
17
  end
16
18
 
17
19
  def self.read_file_content(path, bytes_to_read)
@@ -135,9 +135,9 @@ module Appsignal
135
135
  # @api private
136
136
  def start
137
137
  stop
138
- initialize_probes
139
138
  @@thread = Thread.new do
140
139
  sleep initial_wait_time
140
+ initialize_probes
141
141
  loop do
142
142
  logger = Appsignal.logger
143
143
  logger.debug("Gathering minutely metrics with #{probe_instances.count} probes")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Appsignal
4
- VERSION = "2.9.6".freeze
4
+ VERSION = "2.9.7".freeze
5
5
  end
@@ -1,6 +1,46 @@
1
1
  require "appsignal/cli/diagnose/utils"
2
2
 
3
3
  describe Appsignal::CLI::Diagnose::Utils do
4
+ describe ".username_for_uid" do
5
+ subject { described_class.username_for_uid(uid) }
6
+
7
+ context "when user with id exists" do
8
+ let(:uid) { 0 }
9
+
10
+ it "returns username" do
11
+ is_expected.to be_kind_of(String)
12
+ end
13
+ end
14
+
15
+ context "when user with id does not exist" do
16
+ let(:uid) { -1 }
17
+
18
+ it "returns nil" do
19
+ is_expected.to be_nil
20
+ end
21
+ end
22
+ end
23
+
24
+ describe ".group_for_gid" do
25
+ subject { described_class.group_for_gid(uid) }
26
+
27
+ context "when group with id exists" do
28
+ let(:uid) { 0 }
29
+
30
+ it "returns group name" do
31
+ is_expected.to be_kind_of(String)
32
+ end
33
+ end
34
+
35
+ context "when group with id does not exist" do
36
+ let(:uid) { -3 }
37
+
38
+ it "returns nil" do
39
+ is_expected.to be_nil
40
+ end
41
+ end
42
+ end
43
+
4
44
  describe ".read_file_content" do
5
45
  let(:path) { File.join(spec_system_tmp_dir, "test_file.txt") }
6
46
  let(:bytes_to_read) { 100 }
@@ -167,33 +167,6 @@ describe Appsignal::Minutely do
167
167
  thread && thread.join # Wait for old thread to exit
168
168
  end.to_not(change { alive_thread_counter.call })
169
169
  end
170
-
171
- # Wait for a condition to be met
172
- #
173
- # @example
174
- # # Perform threaded operation
175
- # wait_for("enough probe calls") { probe.calls >= 2 }
176
- # # Assert on result
177
- #
178
- # @param name [String] The name of the condition to check. Used in the
179
- # error when it fails.
180
- # @yield Assertion to check.
181
- # @yieldreturn [Boolean] True/False value that indicates if the condition
182
- # is met.
183
- # @raise [StandardError] Raises error if the condition is not met after 5
184
- # seconds, 5_000 tries.
185
- def wait_for(name)
186
- max_wait = 5_000
187
- i = 0
188
- while i <= max_wait
189
- break if yield
190
- i += 1
191
- sleep 0.001
192
- end
193
-
194
- return unless i == max_wait
195
- raise "Waited 5 seconds for #{name} condition, but was not met."
196
- end
197
170
  end
198
171
 
199
172
  describe ".stop" do
@@ -214,6 +187,9 @@ describe Appsignal::Minutely do
214
187
  Appsignal::Minutely.probes.register :my_probe, -> {}
215
188
  Appsignal::Minutely.start
216
189
  thread = Appsignal::Minutely.class_variable_get(:@@thread)
190
+ wait_for("probes initialized") do
191
+ !Appsignal::Minutely.send(:probe_instances).empty?
192
+ end
217
193
  expect(Appsignal::Minutely.send(:probe_instances)).to_not be_empty
218
194
  Appsignal::Minutely.stop
219
195
  thread.join
@@ -336,4 +312,31 @@ describe Appsignal::Minutely do
336
312
  end
337
313
  end
338
314
  end
315
+
316
+ # Wait for a condition to be met
317
+ #
318
+ # @example
319
+ # # Perform threaded operation
320
+ # wait_for("enough probe calls") { probe.calls >= 2 }
321
+ # # Assert on result
322
+ #
323
+ # @param name [String] The name of the condition to check. Used in the
324
+ # error when it fails.
325
+ # @yield Assertion to check.
326
+ # @yieldreturn [Boolean] True/False value that indicates if the condition
327
+ # is met.
328
+ # @raise [StandardError] Raises error if the condition is not met after 5
329
+ # seconds, 5_000 tries.
330
+ def wait_for(name)
331
+ max_wait = 5_000
332
+ i = 0
333
+ while i <= max_wait
334
+ break if yield
335
+ i += 1
336
+ sleep 0.001
337
+ end
338
+
339
+ return unless i == max_wait
340
+ raise "Waited 5 seconds for #{name} condition, but was not met."
341
+ end
339
342
  end
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.9.6
4
+ version: 2.9.7
5
5
  platform: java
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: 2019-04-30 00:00:00.000000000 Z
12
+ date: 2019-05-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack