prometheus-client-mmap 0.20.2 → 0.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -0
- data/ext/fast_mmaped_file_rs/extconf.rb +21 -15
- data/lib/prometheus/client/formats/text.rb +10 -1
- data/lib/prometheus/client/helper/mmaped_file.rb +8 -1
- data/lib/prometheus/client/version.rb +1 -1
- metadata +24 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddabdc180689b2098a062a41246907e31fc76ce668a4f1ca520c225f802a6dcd
|
4
|
+
data.tar.gz: b41caad16aa1f6710440fca61baf78cc84dd1e9a187f20b7e59afcb39d736b6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5275669d21536a3d379ca606bff7f3df76aaa61df01b8f4ff5ad599304dfb19ec73f156e07eac2157c257373eb49bd4cfdaf951d6321b3dd3af4eb9245e3067
|
7
|
+
data.tar.gz: 65e34ad07012ea9e5e8c61594bbffbf37fa26019bdb673014b597abf10107c5b80c9f6ab065313402225fefcbc6494472f46b7e31e181eeac547e30196c6e071
|
data/README.md
CHANGED
@@ -244,6 +244,19 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
244
244
|
|
245
245
|
To install this gem onto your local machine, run `bundle exec rake install`.
|
246
246
|
|
247
|
+
### Releasing a new version
|
248
|
+
|
249
|
+
To release a new version:
|
250
|
+
|
251
|
+
1. Update `lib/prometheus/client/version.rb` with the version number.
|
252
|
+
1. Update `CHANGELOG.md` with the changes in the release.
|
253
|
+
1. Create a merge request and merge it to `master`.
|
254
|
+
1. Push a new tag to the repository.
|
255
|
+
|
256
|
+
The new version with precompiled, native gems will automatically be
|
257
|
+
published to [RubyGems](https://rubygems.org/gems/prometheus-client-mmap) when the
|
258
|
+
pipeline for the tag completes.
|
259
|
+
|
247
260
|
[1]: https://github.com/prometheus/prometheus
|
248
261
|
[2]: http://rack.github.io/
|
249
262
|
[3]: https://gitlab.com/gitlab-org/prometheus-client-mmap/badges/master/pipeline.svg
|
@@ -1,24 +1,30 @@
|
|
1
1
|
require "mkmf"
|
2
2
|
require "rb_sys/mkmf"
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
if find_executable('rustc')
|
5
|
+
create_rust_makefile("fast_mmaped_file_rs") do |r|
|
6
|
+
r.auto_install_rust_toolchain = false
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
8
|
+
if enable_config('fail-on-warning')
|
9
|
+
r.extra_rustflags = ["-Dwarnings"]
|
10
|
+
end
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
if enable_config('debug')
|
13
|
+
r.profile = :dev
|
14
|
+
end
|
15
|
+
|
16
|
+
if enable_config('address-sanitizer')
|
17
|
+
r.extra_rustflags = ["-Zsanitizer=address"]
|
18
|
+
end
|
14
19
|
|
15
|
-
|
16
|
-
|
20
|
+
# `rb_sys/mkmf` passes all arguments after `--` directly to `cargo rustc`.
|
21
|
+
# We use this awful hack to keep compatibility with existing flags used by
|
22
|
+
# the C implementation.
|
23
|
+
trimmed_argv = ARGV.take_while { |arg| arg != "--" }
|
24
|
+
ARGV = trimmed_argv
|
17
25
|
end
|
26
|
+
else
|
27
|
+
puts 'rustc not found, skipping Rust extension.'
|
18
28
|
|
19
|
-
|
20
|
-
# We use this awful hack to keep compatibility with existing flags used by
|
21
|
-
# the C implementation.
|
22
|
-
trimmed_argv = ARGV.take_while { |arg| arg != "--" }
|
23
|
-
ARGV = trimmed_argv
|
29
|
+
File.write('Makefile', dummy_makefile($srcdir).join(''))
|
24
30
|
end
|
@@ -46,13 +46,22 @@ module Prometheus
|
|
46
46
|
|
47
47
|
private
|
48
48
|
|
49
|
+
def load_rust_extension
|
50
|
+
begin
|
51
|
+
ruby_version = /(\d+\.\d+)/.match(RUBY_VERSION)
|
52
|
+
require_relative "../../../#{ruby_version}/fast_mmaped_file_rs"
|
53
|
+
rescue LoadError
|
54
|
+
require 'fast_mmaped_file_rs'
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
49
58
|
def check_for_rust
|
50
59
|
# This will be evaluated on each invocation even with `||=` if
|
51
60
|
# `@rust_available` if false. Running a `require` statement is slow,
|
52
61
|
# so the `rust_impl_available?` method memoizes the result, external
|
53
62
|
# callers can only trigger this method a single time.
|
54
63
|
@rust_available = begin
|
55
|
-
|
64
|
+
load_rust_extension
|
56
65
|
true
|
57
66
|
rescue LoadError
|
58
67
|
Prometheus::Client.logger.info('FastMmapedFileRs unavailable')
|
@@ -1,6 +1,13 @@
|
|
1
1
|
require 'prometheus/client/helper/entry_parser'
|
2
2
|
require 'prometheus/client/helper/file_locker'
|
3
|
-
|
3
|
+
|
4
|
+
# load precompiled extension if available
|
5
|
+
begin
|
6
|
+
ruby_version = /(\d+\.\d+)/.match(RUBY_VERSION)
|
7
|
+
require_relative "../../../#{ruby_version}/fast_mmaped_file"
|
8
|
+
rescue LoadError
|
9
|
+
require 'fast_mmaped_file'
|
10
|
+
end
|
4
11
|
|
5
12
|
module Prometheus
|
6
13
|
module Client
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
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.21.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Schmidt
|
8
8
|
- Paweł Chojnacki
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-04-
|
12
|
+
date: 2023-04-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rb_sys
|
@@ -79,14 +79,28 @@ dependencies:
|
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 1.2.1
|
83
83
|
type: :development
|
84
84
|
prerelease: false
|
85
85
|
version_requirements: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 1.2.1
|
90
|
+
- !ruby/object:Gem::Dependency
|
91
|
+
name: rake-compiler-dock
|
92
|
+
requirement: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 1.3.0
|
97
|
+
type: :development
|
98
|
+
prerelease: false
|
99
|
+
version_requirements: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 1.3.0
|
90
104
|
- !ruby/object:Gem::Dependency
|
91
105
|
name: ruby-prof
|
92
106
|
requirement: !ruby/object:Gem::Requirement
|
@@ -101,7 +115,7 @@ dependencies:
|
|
101
115
|
- - "~>"
|
102
116
|
- !ruby/object:Gem::Version
|
103
117
|
version: 0.16.2
|
104
|
-
description:
|
118
|
+
description:
|
105
119
|
email:
|
106
120
|
- ts@soundcloud.com
|
107
121
|
- pawel@gitlab.com
|
@@ -197,7 +211,7 @@ homepage: https://gitlab.com/gitlab-org/prometheus-client-mmap
|
|
197
211
|
licenses:
|
198
212
|
- Apache-2.0
|
199
213
|
metadata: {}
|
200
|
-
post_install_message:
|
214
|
+
post_install_message:
|
201
215
|
rdoc_options: []
|
202
216
|
require_paths:
|
203
217
|
- lib
|
@@ -210,10 +224,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
210
224
|
requirements:
|
211
225
|
- - ">="
|
212
226
|
- !ruby/object:Gem::Version
|
213
|
-
version:
|
227
|
+
version: 3.3.22
|
214
228
|
requirements: []
|
215
|
-
rubygems_version: 3.
|
216
|
-
signing_key:
|
229
|
+
rubygems_version: 3.3.26
|
230
|
+
signing_key:
|
217
231
|
specification_version: 4
|
218
232
|
summary: A suite of instrumentation metric primitivesthat can be exposed through a
|
219
233
|
web services interface.
|