protobuf-nats 0.10.5 → 0.10.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 +4 -4
- data/lib/protobuf/nats/server.rb +7 -0
- data/lib/protobuf/nats/thread_pool.rb +8 -0
- data/lib/protobuf/nats/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b24dc4e6dfe807ddff392c7fdf8187dab743915511c996fb8484dd5d7c61361
|
4
|
+
data.tar.gz: d6fa80dcf05264db2520cb0cffb3f60edef7364d491ffaf66c6c1f2d213eb73d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0b1a723daac8e84fa1e1d5727334790498b267fc8396352e6a68914f1aace2cadf693674a1a253409e21d2d1057fdd9dea69eec416b61bb7318ab4501389aab
|
7
|
+
data.tar.gz: 169806eefdc18c2bad9e64a880857c9820d3132178df6b7e4a8744bdd119c7ad649082080e272222c167b15c6f75de855ca7340eda4f36cbf34355da50a6b877
|
data/lib/protobuf/nats/server.rb
CHANGED
@@ -29,6 +29,12 @@ module Protobuf
|
|
29
29
|
@server = options.fetch(:server, ::Socket.gethostname)
|
30
30
|
end
|
31
31
|
|
32
|
+
def instrument_thread_pool_sizes
|
33
|
+
::ActiveSupport::Notifications.instrument("server.thread_pool_enqueued_size.protobuf-nats", thread_pool.enqueued_size)
|
34
|
+
::ActiveSupport::Notifications.instrument("server.thread_pool_max_size.protobuf-nats", thread_pool.max_size)
|
35
|
+
::ActiveSupport::Notifications.instrument("server.thread_pool_running_size.protobuf-nats", thread_pool.size)
|
36
|
+
end
|
37
|
+
|
32
38
|
def max_queue_size
|
33
39
|
::ENV.fetch("PB_NATS_SERVER_MAX_QUEUE_SIZE", @options[:threads]).to_i
|
34
40
|
end
|
@@ -205,6 +211,7 @@ module Protobuf
|
|
205
211
|
loop do
|
206
212
|
break unless @running
|
207
213
|
detect_and_handle_a_pause
|
214
|
+
instrument_thread_pool_sizes
|
208
215
|
sleep 1
|
209
216
|
end
|
210
217
|
|
@@ -22,10 +22,18 @@ module Protobuf
|
|
22
22
|
supervise_workers
|
23
23
|
end
|
24
24
|
|
25
|
+
def enqueued_size
|
26
|
+
@queue.size
|
27
|
+
end
|
28
|
+
|
25
29
|
def full?
|
26
30
|
@active_work >= @max_size
|
27
31
|
end
|
28
32
|
|
33
|
+
def max_size
|
34
|
+
@max_size
|
35
|
+
end
|
36
|
+
|
29
37
|
# This method is not thread safe by design since our IO model is a single producer thread
|
30
38
|
# with multiple consumer threads.
|
31
39
|
def push(&work_cb)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protobuf-nats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Dewitt
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -205,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
205
|
- !ruby/object:Gem::Version
|
206
206
|
version: '0'
|
207
207
|
requirements: []
|
208
|
-
rubygems_version: 3.
|
208
|
+
rubygems_version: 3.5.17
|
209
209
|
signing_key:
|
210
210
|
specification_version: 4
|
211
211
|
summary: ruby-protobuf client/server for nats
|