prometheus-client-mmap 0.27.0-x86_64-darwin → 0.28.0-x86_64-darwin
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/README.md +10 -4
- data/lib/2.7/fast_mmaped_file_rs.bundle +0 -0
- data/lib/3.0/fast_mmaped_file_rs.bundle +0 -0
- data/lib/3.1/fast_mmaped_file.bundle +0 -0
- data/lib/3.1/fast_mmaped_file_rs.bundle +0 -0
- data/lib/3.2/fast_mmaped_file.bundle +0 -0
- data/lib/3.2/fast_mmaped_file_rs.bundle +0 -0
- data/lib/prometheus/client/support/puma.rb +44 -0
- data/lib/prometheus/client/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a538688261158976af3b9b6fcec46a733b52479a6b68e6bdf14be7f25feaccb3
|
4
|
+
data.tar.gz: 45eb08a421e7f53d98966c8b7d037046c0e5b4d36956348abd3b1aaaa103a89c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa9266c3aff8300a977f4fdd916a6e767ecb2a781d70e49c85a90d021acef48f7d64b6f3750b11a20c92a814be93a88a9735f060aeeb7c39edafeb662ec4892b
|
7
|
+
data.tar.gz: ccc92bc3963443d661d4d844b5f41bb46fffe5586a6a8315fa0258e2402b5b535930ff30adcd2f702f3802b45046b52b446fc785640a89128b911c5a8b9aae51
|
data/README.md
CHANGED
@@ -241,8 +241,8 @@ To use the C extension, set the environment variable
|
|
241
241
|
|
242
242
|
### PID cardinality
|
243
243
|
|
244
|
-
In multiprocess setup e.g. running under Unicorn, having worker process restart often
|
245
|
-
lead to performance problems when proccesing metric files. By default each process using
|
244
|
+
In multiprocess setup e.g. running under Unicorn or Puma, having worker process restart often
|
245
|
+
can lead to performance problems when proccesing metric files. By default each process using
|
246
246
|
Prometheus metrics will create a set of files based on that process PID. With high worker
|
247
247
|
churn this will lead to creation of thousands of files and in turn will cause very noticable
|
248
248
|
slowdown when displaying metrics
|
@@ -250,14 +250,20 @@ slowdown when displaying metrics
|
|
250
250
|
To reduce this problem, a surrogate process id can be used. Set of all such IDs needs
|
251
251
|
have low cardinality, and each process id must be unique among all running process.
|
252
252
|
|
253
|
-
For Unicorn a worker id/number can be used to greatly speedup the metrics rendering.
|
253
|
+
For Unicorn and Puma a worker id/number can be used to greatly speedup the metrics rendering.
|
254
254
|
|
255
|
-
|
255
|
+
If you are using Unicorn, add this line to your `configure` block:
|
256
256
|
|
257
257
|
```ruby
|
258
258
|
config.pid_provider = Prometheus::Client::Support::Unicorn.method(:worker_pid_provider)
|
259
259
|
```
|
260
260
|
|
261
|
+
If you are using Puma, add this line to your `configure` block:
|
262
|
+
|
263
|
+
```ruby
|
264
|
+
config.pid_provider = Prometheus::Client::Support::Puma.method(:worker_pid_provider)
|
265
|
+
```
|
266
|
+
|
261
267
|
## Tools
|
262
268
|
|
263
269
|
### `bin/parse`
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Prometheus
|
2
|
+
module Client
|
3
|
+
module Support
|
4
|
+
module Puma
|
5
|
+
extend self
|
6
|
+
|
7
|
+
def worker_pid_provider
|
8
|
+
wid = worker_id
|
9
|
+
if wid = worker_id
|
10
|
+
wid
|
11
|
+
else
|
12
|
+
"process_id_#{Process.pid}"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def object_based_worker_id
|
19
|
+
return unless defined?(::Puma::Cluster::Worker)
|
20
|
+
|
21
|
+
workers = ObjectSpace.each_object(::Puma::Cluster::Worker)
|
22
|
+
return if workers.nil?
|
23
|
+
|
24
|
+
workers_first = workers.first
|
25
|
+
workers_first.index unless workers_first.nil?
|
26
|
+
end
|
27
|
+
|
28
|
+
def program_name
|
29
|
+
$PROGRAM_NAME
|
30
|
+
end
|
31
|
+
|
32
|
+
def worker_id
|
33
|
+
if matchdata = program_name.match(/puma.*cluster worker ([0-9]+):/)
|
34
|
+
"puma_#{matchdata[1]}"
|
35
|
+
elsif object_worker_id = object_based_worker_id
|
36
|
+
"puma_#{object_worker_id}"
|
37
|
+
elsif program_name.include?('puma')
|
38
|
+
'puma_master'
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prometheus-client-mmap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.28.0
|
5
5
|
platform: x86_64-darwin
|
6
6
|
authors:
|
7
7
|
- Tobias Schmidt
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2023-
|
14
|
+
date: 2023-09-02 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rb_sys
|
@@ -197,6 +197,7 @@ files:
|
|
197
197
|
- lib/prometheus/client/registry.rb
|
198
198
|
- lib/prometheus/client/simple_value.rb
|
199
199
|
- lib/prometheus/client/summary.rb
|
200
|
+
- lib/prometheus/client/support/puma.rb
|
200
201
|
- lib/prometheus/client/support/unicorn.rb
|
201
202
|
- lib/prometheus/client/uses_value_type.rb
|
202
203
|
- lib/prometheus/client/version.rb
|