prometheus-client-mmap 0.28.1-arm64-darwin → 1.0.0-arm64-darwin

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.tool-versions +1 -1
  3. data/README.md +2 -30
  4. data/ext/fast_mmaped_file_rs/extconf.rb +1 -3
  5. data/ext/fast_mmaped_file_rs/src/error.rs +8 -0
  6. data/ext/fast_mmaped_file_rs/src/mmap/inner.rs +38 -13
  7. data/ext/fast_mmaped_file_rs/src/mmap.rs +71 -5
  8. data/lib/2.7/fast_mmaped_file_rs.bundle +0 -0
  9. data/lib/3.0/fast_mmaped_file_rs.bundle +0 -0
  10. data/lib/3.1/fast_mmaped_file_rs.bundle +0 -0
  11. data/lib/3.2/fast_mmaped_file_rs.bundle +0 -0
  12. data/lib/prometheus/client/configuration.rb +1 -2
  13. data/lib/prometheus/client/formats/text.rb +1 -12
  14. data/lib/prometheus/client/helper/mmaped_file.rb +3 -14
  15. data/lib/prometheus/client/rack/exporter.rb +1 -3
  16. data/lib/prometheus/client/version.rb +1 -1
  17. metadata +4 -46
  18. data/ext/fast_mmaped_file/extconf.rb +0 -30
  19. data/ext/fast_mmaped_file/fast_mmaped_file.c +0 -122
  20. data/ext/fast_mmaped_file/file_format.c +0 -5
  21. data/ext/fast_mmaped_file/file_format.h +0 -11
  22. data/ext/fast_mmaped_file/file_parsing.c +0 -195
  23. data/ext/fast_mmaped_file/file_parsing.h +0 -27
  24. data/ext/fast_mmaped_file/file_reading.c +0 -102
  25. data/ext/fast_mmaped_file/file_reading.h +0 -30
  26. data/ext/fast_mmaped_file/globals.h +0 -14
  27. data/ext/fast_mmaped_file/mmap.c +0 -428
  28. data/ext/fast_mmaped_file/mmap.h +0 -61
  29. data/ext/fast_mmaped_file/rendering.c +0 -199
  30. data/ext/fast_mmaped_file/rendering.h +0 -8
  31. data/ext/fast_mmaped_file/utils.c +0 -56
  32. data/ext/fast_mmaped_file/utils.h +0 -22
  33. data/ext/fast_mmaped_file/value_access.c +0 -242
  34. data/ext/fast_mmaped_file/value_access.h +0 -15
  35. data/lib/2.7/fast_mmaped_file.bundle +0 -0
  36. data/lib/3.0/fast_mmaped_file.bundle +0 -0
  37. data/lib/3.1/fast_mmaped_file.bundle +0 -0
  38. data/lib/3.2/fast_mmaped_file.bundle +0 -0
  39. data/lib/prometheus/client/helper/loader.rb +0 -44
  40. data/vendor/c/hashmap/.gitignore +0 -52
  41. data/vendor/c/hashmap/LICENSE +0 -21
  42. data/vendor/c/hashmap/README.md +0 -90
  43. data/vendor/c/hashmap/_config.yml +0 -1
  44. data/vendor/c/hashmap/src/hashmap.c +0 -692
  45. data/vendor/c/hashmap/src/hashmap.h +0 -267
  46. data/vendor/c/hashmap/test/Makefile +0 -22
  47. data/vendor/c/hashmap/test/hashmap_test.c +0 -608
  48. data/vendor/c/jsmn/.travis.yml +0 -4
  49. data/vendor/c/jsmn/LICENSE +0 -20
  50. data/vendor/c/jsmn/Makefile +0 -41
  51. data/vendor/c/jsmn/README.md +0 -168
  52. data/vendor/c/jsmn/example/jsondump.c +0 -126
  53. data/vendor/c/jsmn/example/simple.c +0 -76
  54. data/vendor/c/jsmn/jsmn.c +0 -314
  55. data/vendor/c/jsmn/jsmn.h +0 -76
  56. data/vendor/c/jsmn/library.json +0 -16
  57. data/vendor/c/jsmn/test/test.h +0 -27
  58. data/vendor/c/jsmn/test/tests.c +0 -407
  59. data/vendor/c/jsmn/test/testutil.h +0 -94
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af140c4fcee2eda007fe642f90cbddde28819047f8c49991d9b76f0413891acc
4
- data.tar.gz: 4e36c3d6c317d8718fe5a431e07b784e493323bc4f058a335ca1ecbca241b6ad
3
+ metadata.gz: 9d9df78b71d36cb00132ac5a55bf93413aa83c72f9db5e06e875322b792a5960
4
+ data.tar.gz: 2154b6fe6a62c76a755f49f35ebd5865f9edc69746cecf1df0ce07b1873ea1aa
5
5
  SHA512:
6
- metadata.gz: c448775aed81267029e384ca3b34b012b3fe07ddb4b7449812ffbfd3b16d5744f5f400d7c132445c5b2049b0c2843abdfe3549022e03d5d01b57dd4fce2e12a8
7
- data.tar.gz: a0e034ad7851040363a1d29371ea7956e8a4bce72142eaf29775f4f1e720509bfe33a1406ba4f3ec55aab5995c12eba1694de31bf76d960dfd1961649989ccda
6
+ metadata.gz: 929a83c258de11c6ac665854e74cf34f4ea0c7620bccc9cf99f6609c0844948308767291ccdeeae73f5629c413e81efed598de7afe7e93b1316ec2d7ba920e59
7
+ data.tar.gz: 87255dcf19344b59ac15443fbe4c21fc8ef3578422798384c1250d2fe079778a155cea70e16323f23c7c71094509e2a22dc2325f931cb9b52df93244cd21811f
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- rust 1.65.0
1
+ rust 1.73.0
data/README.md CHANGED
@@ -53,19 +53,9 @@ http_requests.increment
53
53
 
54
54
  ## Rust extension
55
55
 
56
- In an effort to improve maintainability, there is now a Rust
56
+ This gem now uses a rewritten Rust extension instead of C.
57
57
  implementation that reads the metric files and outputs the multiprocess
58
- metrics to text. If `rustc` is available, then the Rust extension will
59
- be built automatically. The `use_rust` keyword argument can be used:
60
-
61
- ```ruby
62
- puts Prometheus::Client::Formats::Text.marshal_multiprocess(use_rust: true)
63
- ```
64
-
65
- Starting with v0.26.0, `use_rust` defaults to `true`.
66
-
67
- Note that this parameter will likely be deprecated and removed once the Rust
68
- extension becomes the only supported mode.
58
+ metrics to text. This implementation is significantly faster than the C extension.
69
59
 
70
60
  ### Rack middleware
71
61
 
@@ -219,24 +209,6 @@ Set `prometheus_multiproc_dir` environment variable to the path where you want m
219
209
  prometheus_multiproc_dir=/tmp
220
210
  ```
221
211
 
222
- ### Multiprocess metrics via Rust extension
223
-
224
- By default, the Rust extension will be used to read and write multiprocess
225
- metrics if the `fast_mmaped_file_rs` extension is available. This should
226
- be significantly faster than the C extension.
227
-
228
- If the environment variable `prometheus_rust_multiprocess_metrics=false`
229
- is set or if the `rust_multiprocess_metrics` configuration setting is
230
- `false` , the C extension will be used.
231
-
232
- ### Read and write metrics via Rust extension
233
-
234
- By default, the Rust extension will be used to read and write metrics
235
- from the mmaped file if the `fast_mmaped_file_rs` extension is available.
236
-
237
- To use the C extension, set the environment variable
238
- `prometheus_rust_mmaped_file=false`.
239
-
240
212
  ## Pitfalls
241
213
 
242
214
  ### PID cardinality
@@ -24,7 +24,5 @@ if find_executable('rustc')
24
24
  ARGV = trimmed_argv
25
25
  end
26
26
  else
27
- puts 'rustc not found, skipping Rust extension.'
28
-
29
- File.write('Makefile', dummy_makefile($srcdir).join(''))
27
+ raise 'rustc not found. prometheus-client-mmap now requires Rust.'
30
28
  end
@@ -100,6 +100,13 @@ pub enum MmapError {
100
100
  /// No mmap open.
101
101
  #[error("unmapped file")]
102
102
  UnmappedFile,
103
+ /// File length changed by another process.
104
+ #[error("size of {path} {len} does not match previous size {expected_len}. Another process may have modified it.")]
105
+ UnexpectedFileLength {
106
+ path: String,
107
+ len: usize,
108
+ expected_len: usize,
109
+ },
103
110
  /// A custom error message with `strerror(3)` appended.
104
111
  #[error("{0}")]
105
112
  WithErrno(String),
@@ -162,6 +169,7 @@ impl MmapError {
162
169
  MmapError::Other(_) => RubyError::Arg,
163
170
  MmapError::PromParsing(_) => RubyError::PromParsing,
164
171
  MmapError::UnmappedFile => RubyError::Io,
172
+ MmapError::UnexpectedFileLength { .. } => RubyError::Runtime,
165
173
  MmapError::WithErrno(_) => RubyError::Io,
166
174
  }
167
175
  }
@@ -5,7 +5,7 @@ use std::fs::File;
5
5
  use std::mem::size_of;
6
6
  use std::ops::Range;
7
7
  use std::os::unix::prelude::{AsRawFd, RawFd};
8
- use std::path::PathBuf;
8
+ use std::path::{Path, PathBuf};
9
9
 
10
10
  use crate::error::{MmapError, RubyError};
11
11
  use crate::raw_entry::RawEntry;
@@ -34,6 +34,8 @@ pub(super) struct InnerMmap {
34
34
  ///
35
35
  /// Equivalent to `i_mm->t->real` in the C implementation.
36
36
  len: usize,
37
+ /// The length of the file being mmapped at the time of mapping.
38
+ file_len: usize,
37
39
  }
38
40
 
39
41
  impl InnerMmap {
@@ -41,19 +43,12 @@ impl InnerMmap {
41
43
  /// Use when mmapping a file for the first time. When re-mapping a file
42
44
  /// after expanding it the `reestablish` function should be used.
43
45
  pub fn new(path: PathBuf, file: File) -> Result<Self> {
44
- let stat = file.metadata().map_err(|e| {
45
- MmapError::legacy(
46
- format!("Can't stat {}: {e}", path.display()),
47
- RubyError::Arg,
48
- )
49
- })?;
50
-
51
- let file_size = util::cast_chk::<_, usize>(stat.len(), "file length")?;
46
+ let initial_file_len = get_file_len(&path, &file)?;
52
47
 
53
48
  // We need to ensure the underlying file descriptor is at least a page size.
54
49
  // Otherwise, we could get a SIGBUS error if mmap() attempts to read or write
55
50
  // past the file.
56
- let reserve_size = Self::next_page_boundary(file_size)?;
51
+ let reserve_size = Self::next_page_boundary(initial_file_len)?;
57
52
 
58
53
  // Cast: no-op.
59
54
  Self::reserve_mmap_file_bytes(file.as_raw_fd(), reserve_size as off_t).map_err(|e| {
@@ -67,21 +62,23 @@ impl InnerMmap {
67
62
  })?;
68
63
 
69
64
  // Ensure we always have space for the header.
70
- let map_len = file_size.max(HEADER_SIZE);
65
+ let map_len = initial_file_len.max(HEADER_SIZE);
71
66
 
72
67
  // SAFETY: There is the possibility of UB if the file is modified outside of
73
68
  // this program.
74
69
  let map = unsafe { MmapOptions::new().len(map_len).map_mut(&file) }.map_err(|e| {
75
70
  MmapError::legacy(format!("mmap failed ({}): {e}", errno()), RubyError::Arg)
76
71
  })?;
72
+ let file_len = util::cast_chk::<_, usize>(reserve_size, "file length")?;
77
73
 
78
- let len = file_size;
74
+ let len = initial_file_len;
79
75
 
80
76
  Ok(Self {
81
77
  file,
82
78
  path,
83
79
  map,
84
80
  len,
81
+ file_len,
85
82
  })
86
83
  }
87
84
 
@@ -97,12 +94,14 @@ impl InnerMmap {
97
94
  // to the old length at this point if closing the file. Matching C implementation
98
95
  // for now.
99
96
  let len = map_len;
97
+ let file_len = get_file_len(&path, &file)?;
100
98
 
101
99
  Ok(Self {
102
100
  file,
103
101
  path,
104
102
  map,
105
103
  len,
104
+ file_len,
106
105
  })
107
106
  }
108
107
 
@@ -186,7 +185,7 @@ impl InnerMmap {
186
185
  self.len
187
186
  }
188
187
 
189
- /// The total length in bytes of the mmapped file.
188
+ /// The total length in bytes of the mmapped region of the file.
190
189
  ///
191
190
  /// Equivalent to `i_mm->t->len` in the C implementation.
192
191
  #[inline]
@@ -194,6 +193,21 @@ impl InnerMmap {
194
193
  self.map.len()
195
194
  }
196
195
 
196
+ /// `stat` the mmapped file and return its length.
197
+ pub fn check_file_len(&self) -> Result<usize> {
198
+ get_file_len(&self.path, &self.file)
199
+ }
200
+
201
+ /// The length of the file at the time it was mmapped.
202
+ pub fn file_len(&self) -> usize {
203
+ self.file_len
204
+ }
205
+
206
+ /// The path of the mmapped file.
207
+ pub fn path(&self) -> String {
208
+ self.path.to_string_lossy().to_string()
209
+ }
210
+
197
211
  /// Update the length of the mmap considered to be written.
198
212
  pub fn set_len(&mut self, len: usize) {
199
213
  self.len = len;
@@ -312,6 +326,17 @@ impl InnerMmap {
312
326
  }
313
327
  }
314
328
 
329
+ fn get_file_len(path: &Path, file: &File) -> Result<usize> {
330
+ let stat = file.metadata().map_err(|e| {
331
+ MmapError::legacy(
332
+ format!("Can't stat {}: {e}", path.display()),
333
+ RubyError::Arg,
334
+ )
335
+ })?;
336
+
337
+ util::cast_chk::<_, usize>(stat.len(), "file length")
338
+ }
339
+
315
340
  #[cfg(test)]
316
341
  mod test {
317
342
  use nix::unistd::{self, SysconfVar};
@@ -441,17 +441,49 @@ impl MmapedFile {
441
441
  }
442
442
 
443
443
  /// Check that the mmap is large enough to contain the value to be added,
444
- /// and expand it to fit if necessary.
444
+ /// and expand it to fit if necessary. Will return an error if the file
445
+ /// has been resized by another process.
445
446
  fn check_expand(&self, rb_self: Obj<Self>, key_len: usize) -> magnus::error::Result<()> {
446
447
  // CAST: no-op on 32-bit, widening on 64-bit.
447
448
  let used = self.inner(|inner| inner.load_used())? as usize;
448
449
  let entry_len = RawEntry::calc_total_len(key_len)?;
450
+ let required_len = used.add_chk(entry_len)?;
451
+ let mut target_cap = self.capacity();
449
452
 
453
+ let mut needs_resize = false;
450
454
  // We need the mmapped region to contain at least one byte beyond the
451
- // written data to create a NUL- terminated C string. Validate that
452
- // new length does not exactly match or exceed the length of the mmap.
453
- while self.capacity() <= used.add_chk(entry_len)? {
454
- self.expand_to_fit(rb_self, self.capacity().mul_chk(2)?)?;
455
+ // written data to create a NUL-terminated C string. Validate that
456
+ // new length does not exactly match the length of the mmap.
457
+ if target_cap <= required_len {
458
+ needs_resize = true;
459
+ target_cap = required_len + 1;
460
+ }
461
+
462
+ let (current_file_len, original_file_len) =
463
+ self.inner(|inner| Ok((inner.check_file_len()?, inner.file_len())))?;
464
+
465
+ let file_modified = current_file_len != original_file_len;
466
+ if file_modified {
467
+ // Ensure our new capacity is at least as large as the actual file.
468
+ // Erroring out without first resizing the mmap would leave us stuck
469
+ // in a bad state.
470
+ target_cap = current_file_len
471
+ }
472
+
473
+ if needs_resize {
474
+ self.expand_to_fit(rb_self, target_cap)?;
475
+ }
476
+
477
+ if file_modified {
478
+ // Return an error so the caller is alerted that there were concurrent writes to the
479
+ // file.
480
+ let path = self.inner(|inner| Ok(inner.path()))?;
481
+ return Err(MmapError::UnexpectedFileLength {
482
+ path,
483
+ len: current_file_len,
484
+ expected_len: original_file_len,
485
+ }
486
+ .into());
455
487
  }
456
488
 
457
489
  Ok(())
@@ -652,6 +684,7 @@ mod test {
652
684
  use super::*;
653
685
  use crate::raw_entry::RawEntry;
654
686
  use crate::testhelper::TestFile;
687
+ use std::os::unix::prelude::AsRawFd;
655
688
 
656
689
  /// Create a wrapped MmapedFile object.
657
690
  fn create_obj() -> Obj<MmapedFile> {
@@ -881,4 +914,37 @@ mod test {
881
914
  // Validate that we have expanded the mmap, ensuring a trailing NUL.
882
915
  assert!(rs_self.capacity() > current_cap);
883
916
  }
917
+
918
+ #[test]
919
+ fn test_detect_external_resize() {
920
+ let _cleanup = unsafe { magnus::embed::init() };
921
+ let ruby = magnus::Ruby::get().unwrap();
922
+ crate::init(&ruby).unwrap();
923
+
924
+ let TestFile {
925
+ file,
926
+ path,
927
+ dir: _dir,
928
+ } = TestFile::new(&[0u8; 8]);
929
+
930
+ let path_str = path.display().to_string();
931
+ let rpath = RString::new(&path_str);
932
+
933
+ // Object created successfully
934
+ let result: std::result::Result<Obj<MmapedFile>, Error> =
935
+ eval!("FastMmapedFileRs.new(path)", path = rpath);
936
+ assert!(result.is_ok());
937
+ let obj = result.unwrap();
938
+
939
+ let rs_self = &*obj;
940
+
941
+ let file_len = 1 << 32;
942
+ nix::unistd::ftruncate(file.as_raw_fd(), file_len).unwrap();
943
+
944
+ // We error when the file is externally modified.
945
+ assert!(rs_self.check_expand(obj, 512).is_err());
946
+
947
+ // We updated the object to use the new size.
948
+ assert_eq!(rs_self.capacity(), file_len as usize);
949
+ }
884
950
  }
Binary file
Binary file
Binary file
Binary file
@@ -7,14 +7,13 @@ require 'tmpdir'
7
7
  module Prometheus
8
8
  module Client
9
9
  class Configuration
10
- attr_accessor :value_class, :multiprocess_files_dir, :initial_mmap_file_size, :logger, :pid_provider, :rust_multiprocess_metrics
10
+ attr_accessor :value_class, :multiprocess_files_dir, :initial_mmap_file_size, :logger, :pid_provider
11
11
 
12
12
  def initialize
13
13
  @value_class = ::Prometheus::Client::MmapedValue
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', 'true') == 'true'
18
17
  @multiprocess_files_dir = ENV.fetch('prometheus_multiproc_dir') do
19
18
  Dir.mktmpdir("prometheus-mmap")
20
19
  end
@@ -1,6 +1,5 @@
1
1
  require 'prometheus/client/uses_value_type'
2
2
  require 'prometheus/client/helper/json_parser'
3
- require 'prometheus/client/helper/loader'
4
3
  require 'prometheus/client/helper/plain_file'
5
4
  require 'prometheus/client/helper/metrics_processing'
6
5
  require 'prometheus/client/helper/metrics_representation'
@@ -27,22 +26,12 @@ module Prometheus
27
26
  Helper::MetricsRepresentation.to_text(metrics)
28
27
  end
29
28
 
30
- def marshal_multiprocess(path = Prometheus::Client.configuration.multiprocess_files_dir, use_rust: true)
29
+ def marshal_multiprocess(path = Prometheus::Client.configuration.multiprocess_files_dir)
31
30
  file_list = Dir.glob(File.join(path, '*.db')).sort
32
31
  .map {|f| Helper::PlainFile.new(f) }
33
32
  .map {|f| [f.filepath, f.multiprocess_mode.to_sym, f.type.to_sym, f.pid] }
34
33
 
35
- if use_rust && Prometheus::Client::Helper::Loader.rust_impl_available?
36
34
  FastMmapedFileRs.to_metrics(file_list.to_a)
37
- else
38
- FastMmapedFile.to_metrics(file_list.to_a)
39
- end
40
- end
41
-
42
- def rust_impl_available?
43
- return @rust_available unless @rust_available.nil?
44
-
45
- check_for_rust
46
35
  end
47
36
 
48
37
  private
@@ -1,29 +1,18 @@
1
1
  require 'prometheus/client/helper/entry_parser'
2
2
  require 'prometheus/client/helper/file_locker'
3
- require 'prometheus/client/helper/loader'
4
3
 
5
4
  # load precompiled extension if available
6
5
  begin
7
6
  ruby_version = /(\d+\.\d+)/.match(RUBY_VERSION)
8
- require_relative "../../../#{ruby_version}/fast_mmaped_file"
7
+ require_relative "../../../#{ruby_version}/fast_mmaped_file_rs"
9
8
  rescue LoadError
10
- require 'fast_mmaped_file'
9
+ require 'fast_mmaped_file_rs'
11
10
  end
12
11
 
13
12
  module Prometheus
14
13
  module Client
15
14
  module Helper
16
- # We can't check `Prometheus::Client.configuration` as this creates a circular dependency
17
- if (ENV.fetch('prometheus_rust_mmaped_file', 'true') == "true" &&
18
- Prometheus::Client::Helper::Loader.rust_impl_available?)
19
- class MmapedFile < FastMmapedFileRs
20
- end
21
- else
22
- class MmapedFile < FastMmapedFile
23
- end
24
- end
25
-
26
- class MmapedFile
15
+ class MmapedFile < FastMmapedFileRs
27
16
  include EntryParser
28
17
 
29
18
  attr_reader :filepath, :size
@@ -62,10 +62,8 @@ module Prometheus
62
62
  end
63
63
 
64
64
  def respond_with(format)
65
- rust_enabled = Prometheus::Client.configuration.rust_multiprocess_metrics
66
-
67
65
  response = if Prometheus::Client.configuration.value_class.multiprocess
68
- format.marshal_multiprocess(use_rust: rust_enabled)
66
+ format.marshal_multiprocess
69
67
  else
70
68
  format.marshal
71
69
  end
@@ -1,5 +1,5 @@
1
1
  module Prometheus
2
2
  module Client
3
- VERSION = '0.28.1'.freeze
3
+ VERSION = '1.0.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.28.1
4
+ version: 1.0.0
5
5
  platform: arm64-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-10-05 00:00:00.000000000 Z
14
+ date: 2023-11-15 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rb_sys
@@ -129,23 +129,6 @@ extra_rdoc_files: []
129
129
  files:
130
130
  - ".tool-versions"
131
131
  - README.md
132
- - ext/fast_mmaped_file/extconf.rb
133
- - ext/fast_mmaped_file/fast_mmaped_file.c
134
- - ext/fast_mmaped_file/file_format.c
135
- - ext/fast_mmaped_file/file_format.h
136
- - ext/fast_mmaped_file/file_parsing.c
137
- - ext/fast_mmaped_file/file_parsing.h
138
- - ext/fast_mmaped_file/file_reading.c
139
- - ext/fast_mmaped_file/file_reading.h
140
- - ext/fast_mmaped_file/globals.h
141
- - ext/fast_mmaped_file/mmap.c
142
- - ext/fast_mmaped_file/mmap.h
143
- - ext/fast_mmaped_file/rendering.c
144
- - ext/fast_mmaped_file/rendering.h
145
- - ext/fast_mmaped_file/utils.c
146
- - ext/fast_mmaped_file/utils.h
147
- - ext/fast_mmaped_file/value_access.c
148
- - ext/fast_mmaped_file/value_access.h
149
132
  - ext/fast_mmaped_file_rs/.cargo/config.toml
150
133
  - ext/fast_mmaped_file_rs/Cargo.lock
151
134
  - ext/fast_mmaped_file_rs/Cargo.toml
@@ -163,13 +146,9 @@ files:
163
146
  - ext/fast_mmaped_file_rs/src/raw_entry.rs
164
147
  - ext/fast_mmaped_file_rs/src/testhelper.rs
165
148
  - ext/fast_mmaped_file_rs/src/util.rs
166
- - lib/2.7/fast_mmaped_file.bundle
167
149
  - lib/2.7/fast_mmaped_file_rs.bundle
168
- - lib/3.0/fast_mmaped_file.bundle
169
150
  - lib/3.0/fast_mmaped_file_rs.bundle
170
- - lib/3.1/fast_mmaped_file.bundle
171
151
  - lib/3.1/fast_mmaped_file_rs.bundle
172
- - lib/3.2/fast_mmaped_file.bundle
173
152
  - lib/3.2/fast_mmaped_file_rs.bundle
174
153
  - lib/prometheus.rb
175
154
  - lib/prometheus/client.rb
@@ -180,7 +159,6 @@ files:
180
159
  - lib/prometheus/client/helper/entry_parser.rb
181
160
  - lib/prometheus/client/helper/file_locker.rb
182
161
  - lib/prometheus/client/helper/json_parser.rb
183
- - lib/prometheus/client/helper/loader.rb
184
162
  - lib/prometheus/client/helper/metrics_processing.rb
185
163
  - lib/prometheus/client/helper/metrics_representation.rb
186
164
  - lib/prometheus/client/helper/mmaped_file.rb
@@ -201,26 +179,6 @@ files:
201
179
  - lib/prometheus/client/support/unicorn.rb
202
180
  - lib/prometheus/client/uses_value_type.rb
203
181
  - lib/prometheus/client/version.rb
204
- - vendor/c/hashmap/.gitignore
205
- - vendor/c/hashmap/LICENSE
206
- - vendor/c/hashmap/README.md
207
- - vendor/c/hashmap/_config.yml
208
- - vendor/c/hashmap/src/hashmap.c
209
- - vendor/c/hashmap/src/hashmap.h
210
- - vendor/c/hashmap/test/Makefile
211
- - vendor/c/hashmap/test/hashmap_test.c
212
- - vendor/c/jsmn/.travis.yml
213
- - vendor/c/jsmn/LICENSE
214
- - vendor/c/jsmn/Makefile
215
- - vendor/c/jsmn/README.md
216
- - vendor/c/jsmn/example/jsondump.c
217
- - vendor/c/jsmn/example/simple.c
218
- - vendor/c/jsmn/jsmn.c
219
- - vendor/c/jsmn/jsmn.h
220
- - vendor/c/jsmn/library.json
221
- - vendor/c/jsmn/test/test.h
222
- - vendor/c/jsmn/test/tests.c
223
- - vendor/c/jsmn/test/testutil.h
224
182
  homepage: https://gitlab.com/gitlab-org/prometheus-client-mmap
225
183
  licenses:
226
184
  - Apache-2.0
@@ -246,6 +204,6 @@ requirements: []
246
204
  rubygems_version: 3.4.4
247
205
  signing_key:
248
206
  specification_version: 4
249
- summary: A suite of instrumentation metric primitivesthat can be exposed through a
250
- web services interface.
207
+ summary: A suite of instrumentation metric primitives that can be exposed through
208
+ a web services interface.
251
209
  test_files: []
@@ -1,30 +0,0 @@
1
- require 'mkmf'
2
- require 'fileutils'
3
-
4
- $CFLAGS << ' -std=c99 -D_POSIX_C_SOURCE=200809L -Wall -Wextra'
5
-
6
- if enable_config('fail-on-warning')
7
- $CFLAGS << ' -Werror'
8
- end
9
-
10
- if enable_config('debug')
11
- $CFLAGS << ' -O0 -g'
12
- end
13
-
14
- if enable_config('address-sanitizer')
15
- $CFLAGS << ' -O -fsanitize=address -fno-omit-frame-pointer -g'
16
- end
17
-
18
- CONFIG['warnflags'].slice!(/ -Wdeclaration-after-statement/)
19
-
20
- cwd = File.expand_path(File.dirname(__FILE__))
21
- vendor_dir = File.join(cwd, '../../vendor/c')
22
- src_dir = File.join(cwd, '../../ext/fast_mmaped_file')
23
-
24
- src_files = %W[#{vendor_dir}/jsmn/jsmn.c #{vendor_dir}/hashmap/src/hashmap.c]
25
- FileUtils.cp(src_files, src_dir)
26
-
27
- $INCFLAGS << " -I#{vendor_dir}/jsmn -I#{vendor_dir}/hashmap/src"
28
-
29
- dir_config('fast_mmaped_file')
30
- create_makefile('fast_mmaped_file')