prometheus-client-mmap 1.2.10 → 1.4.0
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/Cargo.lock +10 -16
- data/ext/fast_mmaped_file_rs/Cargo.toml +4 -4
- data/lib/prometheus/client/histogram.rb +21 -9
- data/lib/prometheus/client/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ed8f9dd2581a68fa270caf399c10cad6c231aaa12b1f77cafadfdfefea4c02d4
|
|
4
|
+
data.tar.gz: 1c25e2ededb62a60e218e446b2e7ce36b54e42c16d0b3f3b8f348c9169f67ae8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 00ac7229cdb82c1446f3fe829f500eb5317f4af28c6ab0e80204dfae8acac989448659d5975d998e6207d87d441380f3df20b394a6a20ee09bdebc9a2f11e8e3
|
|
7
|
+
data.tar.gz: e4418b7ed3dd040317b5d64295ce195483ee316f02fd43c0e7746744a44ef3d014e01f7b33270fe0fed8d37dc6ee836c4d7aac29d357629a8993f63a80841e73
|
data/Cargo.lock
CHANGED
|
@@ -165,7 +165,7 @@ dependencies = [
|
|
|
165
165
|
"nix",
|
|
166
166
|
"rand",
|
|
167
167
|
"rb-sys",
|
|
168
|
-
"rb-sys-env
|
|
168
|
+
"rb-sys-env",
|
|
169
169
|
"serde",
|
|
170
170
|
"serde_json",
|
|
171
171
|
"sha2",
|
|
@@ -282,21 +282,21 @@ checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12"
|
|
|
282
282
|
|
|
283
283
|
[[package]]
|
|
284
284
|
name = "magnus"
|
|
285
|
-
version = "0.
|
|
285
|
+
version = "0.8.2"
|
|
286
286
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
287
|
-
checksum = "
|
|
287
|
+
checksum = "3b36a5b126bbe97eb0d02d07acfeb327036c6319fd816139a49824a83b7f9012"
|
|
288
288
|
dependencies = [
|
|
289
289
|
"magnus-macros",
|
|
290
290
|
"rb-sys",
|
|
291
|
-
"rb-sys-env
|
|
291
|
+
"rb-sys-env",
|
|
292
292
|
"seq-macro",
|
|
293
293
|
]
|
|
294
294
|
|
|
295
295
|
[[package]]
|
|
296
296
|
name = "magnus-macros"
|
|
297
|
-
version = "0.
|
|
297
|
+
version = "0.8.0"
|
|
298
298
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
299
|
-
checksum = "
|
|
299
|
+
checksum = "47607461fd8e1513cb4f2076c197d8092d921a1ea75bd08af97398f593751892"
|
|
300
300
|
dependencies = [
|
|
301
301
|
"proc-macro2",
|
|
302
302
|
"quote",
|
|
@@ -433,18 +433,18 @@ dependencies = [
|
|
|
433
433
|
|
|
434
434
|
[[package]]
|
|
435
435
|
name = "rb-sys"
|
|
436
|
-
version = "0.9.
|
|
436
|
+
version = "0.9.117"
|
|
437
437
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
438
|
-
checksum = "
|
|
438
|
+
checksum = "f900d1ce4629a2ebffaf5de74bd8f9c1188d4c5ed406df02f97e22f77a006f44"
|
|
439
439
|
dependencies = [
|
|
440
440
|
"rb-sys-build",
|
|
441
441
|
]
|
|
442
442
|
|
|
443
443
|
[[package]]
|
|
444
444
|
name = "rb-sys-build"
|
|
445
|
-
version = "0.9.
|
|
445
|
+
version = "0.9.117"
|
|
446
446
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
447
|
-
checksum = "
|
|
447
|
+
checksum = "ef1e9c857028f631056bcd6d88cec390c751e343ce2223ddb26d23eb4a151d59"
|
|
448
448
|
dependencies = [
|
|
449
449
|
"bindgen",
|
|
450
450
|
"lazy_static",
|
|
@@ -455,12 +455,6 @@ dependencies = [
|
|
|
455
455
|
"syn",
|
|
456
456
|
]
|
|
457
457
|
|
|
458
|
-
[[package]]
|
|
459
|
-
name = "rb-sys-env"
|
|
460
|
-
version = "0.1.2"
|
|
461
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
462
|
-
checksum = "a35802679f07360454b418a5d1735c89716bde01d35b1560fc953c1415a0b3bb"
|
|
463
|
-
|
|
464
458
|
[[package]]
|
|
465
459
|
name = "rb-sys-env"
|
|
466
460
|
version = "0.2.2"
|
|
@@ -6,13 +6,13 @@ edition = "2021"
|
|
|
6
6
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
7
7
|
|
|
8
8
|
[dependencies]
|
|
9
|
-
hashbrown = "0.15.
|
|
9
|
+
hashbrown = "0.15.3"
|
|
10
10
|
libc = "0.2.172"
|
|
11
|
-
magnus = { version = "0.
|
|
11
|
+
magnus = { version = "0.8.2", features = ["rb-sys"] }
|
|
12
12
|
memmap2 = "0.9.5"
|
|
13
13
|
# v0.26 cannot be built on CentOS 7 https://github.com/nix-rust/nix/issues/1972
|
|
14
14
|
nix = { version = "0.25", features = ["mman"] } # mman used for MsFlags
|
|
15
|
-
rb-sys = { version = "0.9.
|
|
15
|
+
rb-sys = { version = "0.9.117", features = ["stable-api-compiled-fallback"] }
|
|
16
16
|
serde = { version = "1.0.219", features = ["derive"] }
|
|
17
17
|
serde_json = { version = "1.0.140", features = ["raw_value"] }
|
|
18
18
|
smallvec = { version = "1.15", features = ["serde"] }
|
|
@@ -22,7 +22,7 @@ thiserror = "2.0.12"
|
|
|
22
22
|
bstr = "1.12"
|
|
23
23
|
indoc = "2.0.6"
|
|
24
24
|
# We need the `embed` feature to run tests, but this triggers failures when building as a Gem.
|
|
25
|
-
magnus = { version = "0.
|
|
25
|
+
magnus = { version = "0.8.2", features = ["rb-sys","embed"] }
|
|
26
26
|
rand = "0.9.1"
|
|
27
27
|
sha2 = "0.10.9"
|
|
28
28
|
tempfile = "3.19.1"
|
|
@@ -12,29 +12,37 @@ module Prometheus
|
|
|
12
12
|
include UsesValueType
|
|
13
13
|
attr_accessor :sum, :total, :total_inf
|
|
14
14
|
|
|
15
|
-
def initialize(type, name, labels, buckets)
|
|
15
|
+
def initialize(type, name, labels, buckets, buckets_descending)
|
|
16
16
|
@sum = value_object(type, name, "#{name}_sum", labels)
|
|
17
17
|
@total = value_object(type, name, "#{name}_count", labels)
|
|
18
18
|
@total_inf = value_object(type, name, "#{name}_bucket", labels.merge(le: "+Inf"))
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
# Buckets are precomputed/frozen at the metric level; values hold
|
|
21
|
+
# references to avoid per-label duplication.
|
|
22
|
+
@buckets, @buckets_descending = buckets, buckets_descending
|
|
23
|
+
|
|
24
|
+
@buckets.each do |bucket|
|
|
21
25
|
self[bucket] = value_object(type, name, "#{name}_bucket", labels.merge(le: bucket.to_s))
|
|
22
26
|
end
|
|
23
27
|
end
|
|
24
28
|
|
|
25
29
|
def observe(value)
|
|
26
|
-
@sum.increment(value)
|
|
27
|
-
@total.increment()
|
|
28
30
|
@total_inf.increment()
|
|
31
|
+
@total.increment()
|
|
32
|
+
@sum.increment(value)
|
|
29
33
|
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
# Write buckets from largest to smallest so any reader always sees
|
|
35
|
+
# monotonic (cumulative) counts; stop once the observation no longer
|
|
36
|
+
# fits to skip needless increments.
|
|
37
|
+
@buckets_descending.each do |bucket|
|
|
38
|
+
break if value > bucket
|
|
39
|
+
self[bucket].increment()
|
|
32
40
|
end
|
|
33
41
|
end
|
|
34
42
|
|
|
35
43
|
def get()
|
|
36
44
|
hash = {}
|
|
37
|
-
|
|
45
|
+
@buckets.each do |bucket|
|
|
38
46
|
hash[bucket] = self[bucket].get()
|
|
39
47
|
end
|
|
40
48
|
hash
|
|
@@ -52,7 +60,11 @@ module Prometheus
|
|
|
52
60
|
buckets = DEFAULT_BUCKETS)
|
|
53
61
|
raise ArgumentError, 'Unsorted buckets, typo?' unless sorted? buckets
|
|
54
62
|
|
|
55
|
-
|
|
63
|
+
# Precompute both orders once per metric. Shared across all label sets
|
|
64
|
+
# to avoid per-value allocation and per-observe reverse calls.
|
|
65
|
+
@buckets = buckets.dup.freeze
|
|
66
|
+
@buckets_descending = @buckets.reverse.freeze
|
|
67
|
+
|
|
56
68
|
super(name, docstring, base_labels)
|
|
57
69
|
end
|
|
58
70
|
|
|
@@ -69,7 +81,7 @@ module Prometheus
|
|
|
69
81
|
|
|
70
82
|
def default(labels)
|
|
71
83
|
# TODO: default function needs to know key of hash info (label names and values)
|
|
72
|
-
Value.new(type, @name, labels, @buckets)
|
|
84
|
+
Value.new(type, @name, labels, @buckets, @buckets_descending)
|
|
73
85
|
end
|
|
74
86
|
|
|
75
87
|
def sorted?(bucket)
|
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: 1.
|
|
4
|
+
version: 1.4.0
|
|
5
5
|
platform: ruby
|
|
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: 2025-
|
|
14
|
+
date: 2025-12-02 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: base64
|
|
@@ -61,14 +61,14 @@ dependencies:
|
|
|
61
61
|
requirements:
|
|
62
62
|
- - "~>"
|
|
63
63
|
- !ruby/object:Gem::Version
|
|
64
|
-
version: 0.9.
|
|
64
|
+
version: 0.9.117
|
|
65
65
|
type: :runtime
|
|
66
66
|
prerelease: false
|
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
|
68
68
|
requirements:
|
|
69
69
|
- - "~>"
|
|
70
70
|
- !ruby/object:Gem::Version
|
|
71
|
-
version: 0.9.
|
|
71
|
+
version: 0.9.117
|
|
72
72
|
- !ruby/object:Gem::Dependency
|
|
73
73
|
name: fuzzbert
|
|
74
74
|
requirement: !ruby/object:Gem::Requirement
|