prometheus-client-mmap 0.25.0 → 0.26.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: 15dde2bfa3d25ee344e811944e599f0a64ed199caf949310cbfc99a7af4ccfd3
4
- data.tar.gz: 6bd6f3a9d0d7c055b1138acfe06f6d206edeb73481eff5be82079ed36c73c64e
3
+ metadata.gz: 94ad1d9acceaff1f75911cfe6665b1ed016916305e51865d5c4b49c22c81b880
4
+ data.tar.gz: 990a2ebcdf397bf025b8cd11eb3dc49227733b4590ab2cfff5a1b564e882362f
5
5
  SHA512:
6
- metadata.gz: 23e114d89e09c771308e877ee0218aa94daf01df55ff0c29875a41281b762ecc09e831b0e5bafcaf7aa5b9b6a67d8e95328bbeaf2ddad867b6901a301650a068
7
- data.tar.gz: 0e1c4b6bce251e33c8551eba06b5b1167cdd3e56eaaac9caee7f9256546c83430a66e8d7481bad550e52bb6690810e31f688379a65792e1d81d251b36a8958dd
6
+ metadata.gz: 4d6919e8a5c0c61fc3cbfce2a2e09ba9f5eb71e9bca9710533c950d6a93c6ba2f9539e6e194b08707f5e0722a1d65d7d85c152cf007e893957f35f6135d5695c
7
+ data.tar.gz: 90ddef5880f7f48f82488abe9a4dd124d6520af0c42fc2f25fab8bb3599cd38258755737c2a0eb1fdf23c8a8d7982b1a8ae6bcffddfffb31f624178ba042c177
data/README.md CHANGED
@@ -34,7 +34,7 @@ http_requests = prometheus.counter(:http_requests, 'A counter of HTTP requests m
34
34
  http_requests.increment
35
35
  ```
36
36
 
37
- ## Rust extension (experimental)
37
+ ## Rust extension
38
38
 
39
39
  In an effort to improve maintainability, there is now an optional Rust
40
40
  implementation that reads the metric files and outputs the multiprocess
@@ -202,14 +202,21 @@ prometheus_multiproc_dir=/tmp
202
202
 
203
203
  ### Multiprocess metrics via Rust extension
204
204
 
205
- If the environment variable `prometheus_rust_multiprocess_metrics=true` is set or if the `rust_multiprocess_metrics`
206
- configuration setting is `true` and the `fast_mmaped_file_rs` extension is available, it will be used to generate
207
- multiprocess metrics. This should be significantly faster than the C extension.
205
+ By default, the Rust extension will be used to read and write multiprocess
206
+ metrics if the `fast_mmaped_file_rs` extension is available. This should
207
+ be significantly faster than the C extension.
208
+
209
+ If the environment variable `prometheus_rust_multiprocess_metrics=false`
210
+ is set or if the `rust_multiprocess_metrics` configuration setting is
211
+ `false` , the C extension will be used.
208
212
 
209
213
  ### Read and write metrics via Rust extension
210
214
 
211
- If the environment variable `prometheus_rust_mmaped_file=true` is set then if the `fast_mmaped_file_rs`
212
- extension is available it will be used to read and write metrics from the mmapped file.
215
+ By default, the Rust extension will be used to read and write metrics
216
+ from the mmaped file if the `fast_mmaped_file_rs` extension is available.
217
+
218
+ To use the C extension, set the environment variable
219
+ `prometheus_rust_mmaped_file=false`.
213
220
 
214
221
  ## Pitfalls
215
222
 
@@ -14,7 +14,7 @@ module Prometheus
14
14
  @initial_mmap_file_size = ::Prometheus::Client::PageSize.page_size(fallback_page_size: 4096)
15
15
  @logger = Logger.new($stdout)
16
16
  @pid_provider = Process.method(:pid)
17
- @rust_multiprocess_metrics = ENV.fetch('prometheus_rust_multiprocess_metrics', nil) == 'true'
17
+ @rust_multiprocess_metrics = ENV.fetch('prometheus_rust_multiprocess_metrics', 'true') == 'true'
18
18
  @multiprocess_files_dir = ENV.fetch('prometheus_multiproc_dir') do
19
19
  Dir.mktmpdir("prometheus-mmap")
20
20
  end
@@ -27,7 +27,7 @@ module Prometheus
27
27
  Helper::MetricsRepresentation.to_text(metrics)
28
28
  end
29
29
 
30
- def marshal_multiprocess(path = Prometheus::Client.configuration.multiprocess_files_dir, use_rust: false)
30
+ def marshal_multiprocess(path = Prometheus::Client.configuration.multiprocess_files_dir, use_rust: true)
31
31
  file_list = Dir.glob(File.join(path, '*.db')).sort
32
32
  .map {|f| Helper::PlainFile.new(f) }
33
33
  .map {|f| [f.filepath, f.multiprocess_mode.to_sym, f.type.to_sym, f.pid] }
@@ -14,7 +14,7 @@ module Prometheus
14
14
  module Client
15
15
  module Helper
16
16
  # We can't check `Prometheus::Client.configuration` as this creates a circular dependency
17
- if (ENV.fetch('prometheus_rust_mmaped_file', nil) == "true" &&
17
+ if (ENV.fetch('prometheus_rust_mmaped_file', 'true') == "true" &&
18
18
  Prometheus::Client::Helper::Loader.rust_impl_available?)
19
19
  class MmapedFile < FastMmapedFileRs
20
20
  end
@@ -1,5 +1,5 @@
1
1
  module Prometheus
2
2
  module Client
3
- VERSION = '0.25.0'.freeze
3
+ VERSION = '0.26.0'.freeze
4
4
  end
5
5
  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.25.0
4
+ version: 0.26.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: 2023-06-15 00:00:00.000000000 Z
14
+ date: 2023-06-20 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rb_sys