async-pool 0.9.0 → 0.10.0

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: 958468bc2e159bc6304f603d522ccc08fe967469bd463a992484f237e880ddf3
4
- data.tar.gz: 2fcd90d3589cb71a9395b0e9b9810dc860bda4971c538e754d7a4113e1628ff0
3
+ metadata.gz: ac992b5e13d56d0441655030e1ac893d10ceda32d022b38daf45e12539b8199e
4
+ data.tar.gz: 14d3a0585ad5d89f6b5016858b8fba5096bb71a703f9fafa1fcfe927ccad3355
5
5
  SHA512:
6
- metadata.gz: 5a03eb3421cd11bc52ec995ddadd67c9e717763a69dbed5d8d27248f0b93ec9e824765eef5a8d02719968fc20f974d4b7690ec8a1e66fa6cc5d103f95f56ce0d
7
- data.tar.gz: f4f19064995d171e013e5d80c90343387c733e9f13a4acd846c1534aee573ff7f75c5d3d41907919bdd83ff09bd1112e6a9d7f063ed66e4e072e91648220ae2b
6
+ metadata.gz: f9ca9ce26be39afc0986243da26a97432ebc1761ba71e9f4ac2de8e7a9fdad161600276430a52737ddac43226c012c465c471c74442c4f5e146a4b20d530a5b1
7
+ data.tar.gz: bd9e8f5f3a90c08ae3faadfcd5d7ef1db9063d57b25e8ed2f981ccdba31968cfffdc98e1456fa01b5f42f1d112d1db560d69896fd7e9319225ac916aa8787422
checksums.yaml.gz.sig CHANGED
Binary file
@@ -12,7 +12,6 @@ require "async/notification"
12
12
  require "async/semaphore"
13
13
 
14
14
  require "traces"
15
- require "metrics"
16
15
 
17
16
  module Async
18
17
  module Pool
@@ -39,7 +38,7 @@ module Async
39
38
  @policy = policy
40
39
  @gardener = nil
41
40
 
42
- @tags = Metrics::Tags.normalize(tags)
41
+ @tags = tags
43
42
 
44
43
  # All available resources:
45
44
  @resources = {}
@@ -393,43 +392,58 @@ module Async
393
392
  concurrency: @guard.limit,
394
393
  size: @resources.size,
395
394
  limit: @limit,
396
- tags: @tags,
397
395
  }
398
396
 
399
- Traces.trace("async.pool.create", attributes: attributes) {super}
397
+ @attributes.merge!(@tags) if @tags
398
+
399
+ Traces.trace('async.pool.create', attributes: attributes) {super}
400
400
  end
401
401
 
402
402
  def drain(...)
403
403
  attributes = {
404
404
  size: @resources.size,
405
- tags: @tags,
406
405
  }
407
406
 
408
- Traces.trace("async.pool.drain", attributes: attributes) {super}
407
+ @attributes.merge!(@tags) if @tags
408
+
409
+ Traces.trace('async.pool.drain', attributes: attributes) {super}
409
410
  end
410
- end
411
-
412
- Metrics::Provider(self) do
413
- ACQUIRE_COUNT = Metrics.metric("async.pool.acquire", :counter, description: "Number of times a resource was invoked.")
414
- RELEASE_COUNT = Metrics.metric("async.pool.release", :counter, description: "Number of times a resource was released.")
415
- RETIRE_COUNT = Metrics.metric("async.pool.retire", :counter, description: "Number of times a resource was retired.")
416
411
 
417
412
  def acquire(...)
418
- ACQUIRE_COUNT.emit(1, tags: @tags)
413
+ attributes = {
414
+ concurrency: @guard.limit,
415
+ size: @resources.size,
416
+ limit: @limit,
417
+ }
418
+
419
+ @attributes.merge!(@tags) if @tags
419
420
 
420
- super
421
+ Traces.trace('async.pool.acquire', attributes: attributes) {super}
421
422
  end
422
423
 
423
424
  def release(...)
424
- super.tap do
425
- RELEASE_COUNT.emit(1, tags: @tags)
426
- end
425
+ attributes = {
426
+ concurrency: @guard.limit,
427
+ size: @resources.size,
428
+ limit: @limit,
429
+ }
430
+
431
+ @attributes.merge!(@tags) if @tags
432
+
433
+ Traces.trace('async.pool.release', attributes: attributes) {super}
427
434
  end
428
435
 
429
436
  def retire(...)
430
- super.tap do
431
- RETIRE_COUNT.emit(1, tags: @tags)
432
- end
437
+ attributes = {
438
+ concurrency: @guard.limit,
439
+ size: @resources.size,
440
+ limit: @limit,
441
+ **@tags,
442
+ }
443
+
444
+ @attributes.merge!(@tags) if @tags
445
+
446
+ Traces.trace('async.pool.retire', attributes: attributes) {super}
433
447
  end
434
448
  end
435
449
  end
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module Pool
8
- VERSION = "0.9.0"
8
+ VERSION = "0.10.0"
9
9
  end
10
10
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-pool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -40,7 +40,7 @@ cert_chain:
40
40
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
41
41
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
42
42
  -----END CERTIFICATE-----
43
- date: 2024-10-12 00:00:00.000000000 Z
43
+ date: 2024-10-13 00:00:00.000000000 Z
44
44
  dependencies:
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: async
@@ -56,20 +56,6 @@ dependencies:
56
56
  - - ">="
57
57
  - !ruby/object:Gem::Version
58
58
  version: '1.25'
59
- - !ruby/object:Gem::Dependency
60
- name: metrics
61
- requirement: !ruby/object:Gem::Requirement
62
- requirements:
63
- - - "~>"
64
- - !ruby/object:Gem::Version
65
- version: '0.11'
66
- type: :runtime
67
- prerelease: false
68
- version_requirements: !ruby/object:Gem::Requirement
69
- requirements:
70
- - - "~>"
71
- - !ruby/object:Gem::Version
72
- version: '0.11'
73
59
  - !ruby/object:Gem::Dependency
74
60
  name: traces
75
61
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file