vinted-prometheus-client-mmap 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +2 -0
- data/ext/fast_mmaped_file_rs/Cargo.toml +40 -0
- data/ext/fast_mmaped_file_rs/README.md +52 -0
- data/ext/fast_mmaped_file_rs/build.rs +7 -0
- data/ext/fast_mmaped_file_rs/extconf.rb +28 -0
- data/ext/fast_mmaped_file_rs/src/error.rs +174 -0
- data/ext/fast_mmaped_file_rs/src/exemplars.rs +25 -0
- data/ext/fast_mmaped_file_rs/src/file_entry.rs +1190 -0
- data/ext/fast_mmaped_file_rs/src/file_info.rs +240 -0
- data/ext/fast_mmaped_file_rs/src/lib.rs +87 -0
- data/ext/fast_mmaped_file_rs/src/macros.rs +14 -0
- data/ext/fast_mmaped_file_rs/src/map.rs +492 -0
- data/ext/fast_mmaped_file_rs/src/metrics.proto +153 -0
- data/ext/fast_mmaped_file_rs/src/mmap/inner.rs +704 -0
- data/ext/fast_mmaped_file_rs/src/mmap.rs +896 -0
- data/ext/fast_mmaped_file_rs/src/raw_entry.rs +473 -0
- data/ext/fast_mmaped_file_rs/src/testhelper.rs +222 -0
- data/ext/fast_mmaped_file_rs/src/util.rs +121 -0
- data/lib/.DS_Store +0 -0
- data/lib/prometheus/.DS_Store +0 -0
- data/lib/prometheus/client/configuration.rb +23 -0
- data/lib/prometheus/client/counter.rb +27 -0
- data/lib/prometheus/client/formats/protobuf.rb +92 -0
- data/lib/prometheus/client/formats/text.rb +85 -0
- data/lib/prometheus/client/gauge.rb +40 -0
- data/lib/prometheus/client/helper/entry_parser.rb +132 -0
- data/lib/prometheus/client/helper/file_locker.rb +50 -0
- data/lib/prometheus/client/helper/json_parser.rb +23 -0
- data/lib/prometheus/client/helper/metrics_processing.rb +45 -0
- data/lib/prometheus/client/helper/metrics_representation.rb +51 -0
- data/lib/prometheus/client/helper/mmaped_file.rb +64 -0
- data/lib/prometheus/client/helper/plain_file.rb +29 -0
- data/lib/prometheus/client/histogram.rb +80 -0
- data/lib/prometheus/client/label_set_validator.rb +85 -0
- data/lib/prometheus/client/metric.rb +80 -0
- data/lib/prometheus/client/mmaped_dict.rb +79 -0
- data/lib/prometheus/client/mmaped_value.rb +158 -0
- data/lib/prometheus/client/page_size.rb +17 -0
- data/lib/prometheus/client/push.rb +203 -0
- data/lib/prometheus/client/rack/collector.rb +88 -0
- data/lib/prometheus/client/rack/exporter.rb +102 -0
- data/lib/prometheus/client/registry.rb +65 -0
- data/lib/prometheus/client/simple_value.rb +31 -0
- data/lib/prometheus/client/summary.rb +69 -0
- data/lib/prometheus/client/support/puma.rb +44 -0
- data/lib/prometheus/client/support/unicorn.rb +35 -0
- data/lib/prometheus/client/uses_value_type.rb +20 -0
- data/lib/prometheus/client/version.rb +5 -0
- data/lib/prometheus/client.rb +58 -0
- data/lib/prometheus.rb +3 -0
- metadata +203 -0
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'prometheus/client/registry'
|
2
|
+
require 'prometheus/client/configuration'
|
3
|
+
require 'prometheus/client/mmaped_value'
|
4
|
+
|
5
|
+
module Prometheus
|
6
|
+
# Client is a ruby implementation for a Prometheus compatible client.
|
7
|
+
module Client
|
8
|
+
class << self
|
9
|
+
attr_writer :configuration
|
10
|
+
|
11
|
+
def configuration
|
12
|
+
@configuration ||= Configuration.new
|
13
|
+
end
|
14
|
+
|
15
|
+
def configure
|
16
|
+
yield(configuration)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Returns a default registry object
|
20
|
+
def registry
|
21
|
+
@registry ||= Registry.new
|
22
|
+
end
|
23
|
+
|
24
|
+
def logger
|
25
|
+
configuration.logger
|
26
|
+
end
|
27
|
+
|
28
|
+
def pid
|
29
|
+
configuration.pid_provider.call
|
30
|
+
end
|
31
|
+
|
32
|
+
# Resets the registry and reinitializes all metrics files.
|
33
|
+
# Use case: clean up everything in specs `before` block,
|
34
|
+
# to prevent leaking the state between specs which are updating metrics.
|
35
|
+
def reset!
|
36
|
+
@registry = nil
|
37
|
+
::Prometheus::Client::MmapedValue.reset_and_reinitialize
|
38
|
+
end
|
39
|
+
|
40
|
+
def cleanup!
|
41
|
+
Dir.glob("#{configuration.multiprocess_files_dir}/*.db").each { |f| File.unlink(f) if File.exist?(f) }
|
42
|
+
end
|
43
|
+
|
44
|
+
# With `force: false`: reinitializes metric files only for processes with the changed PID.
|
45
|
+
# With `force: true`: reinitializes all metrics files.
|
46
|
+
# Always keeps the registry.
|
47
|
+
# Use case (`force: false`): pick up new metric files on each worker start,
|
48
|
+
# without resetting already registered files for the master or previously initialized workers.
|
49
|
+
def reinitialize_on_pid_change(force: false)
|
50
|
+
if force
|
51
|
+
::Prometheus::Client::MmapedValue.reset_and_reinitialize
|
52
|
+
else
|
53
|
+
::Prometheus::Client::MmapedValue.reinitialize_on_pid_change
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
data/lib/prometheus.rb
ADDED
metadata
ADDED
@@ -0,0 +1,203 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: vinted-prometheus-client-mmap
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.2.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tobias Schmidt
|
8
|
+
- Paweł Chojnacki
|
9
|
+
- Stan Hu
|
10
|
+
- Will Chandler
|
11
|
+
autorequire:
|
12
|
+
bindir: bin
|
13
|
+
cert_chain: []
|
14
|
+
date: 2024-03-26 00:00:00.000000000 Z
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: rb_sys
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - "~>"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.9.86
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.9.86
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: fuzzbert
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - "~>"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '1.0'
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 1.0.4
|
40
|
+
type: :development
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '1.0'
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 1.0.4
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
name: gem_publisher
|
52
|
+
requirement: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - "~>"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '1'
|
57
|
+
type: :development
|
58
|
+
prerelease: false
|
59
|
+
version_requirements: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - "~>"
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '1'
|
64
|
+
- !ruby/object:Gem::Dependency
|
65
|
+
name: pry
|
66
|
+
requirement: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - "~>"
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: 0.12.2
|
71
|
+
type: :development
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - "~>"
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 0.12.2
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rake-compiler
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - "~>"
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: 1.2.1
|
85
|
+
type: :development
|
86
|
+
prerelease: false
|
87
|
+
version_requirements: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - "~>"
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: 1.2.1
|
92
|
+
- !ruby/object:Gem::Dependency
|
93
|
+
name: rake-compiler-dock
|
94
|
+
requirement: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - "~>"
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: 1.4.0
|
99
|
+
type: :development
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - "~>"
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: 1.4.0
|
106
|
+
- !ruby/object:Gem::Dependency
|
107
|
+
name: ruby-prof
|
108
|
+
requirement: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - "~>"
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 0.16.2
|
113
|
+
type: :development
|
114
|
+
prerelease: false
|
115
|
+
version_requirements: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - "~>"
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: 0.16.2
|
120
|
+
description:
|
121
|
+
email:
|
122
|
+
- backend@vinted.com
|
123
|
+
executables: []
|
124
|
+
extensions:
|
125
|
+
- ext/fast_mmaped_file_rs/extconf.rb
|
126
|
+
extra_rdoc_files: []
|
127
|
+
files:
|
128
|
+
- README.md
|
129
|
+
- ext/fast_mmaped_file_rs/Cargo.toml
|
130
|
+
- ext/fast_mmaped_file_rs/README.md
|
131
|
+
- ext/fast_mmaped_file_rs/build.rs
|
132
|
+
- ext/fast_mmaped_file_rs/extconf.rb
|
133
|
+
- ext/fast_mmaped_file_rs/src/error.rs
|
134
|
+
- ext/fast_mmaped_file_rs/src/exemplars.rs
|
135
|
+
- ext/fast_mmaped_file_rs/src/file_entry.rs
|
136
|
+
- ext/fast_mmaped_file_rs/src/file_info.rs
|
137
|
+
- ext/fast_mmaped_file_rs/src/lib.rs
|
138
|
+
- ext/fast_mmaped_file_rs/src/macros.rs
|
139
|
+
- ext/fast_mmaped_file_rs/src/map.rs
|
140
|
+
- ext/fast_mmaped_file_rs/src/metrics.proto
|
141
|
+
- ext/fast_mmaped_file_rs/src/mmap.rs
|
142
|
+
- ext/fast_mmaped_file_rs/src/mmap/inner.rs
|
143
|
+
- ext/fast_mmaped_file_rs/src/raw_entry.rs
|
144
|
+
- ext/fast_mmaped_file_rs/src/testhelper.rs
|
145
|
+
- ext/fast_mmaped_file_rs/src/util.rs
|
146
|
+
- lib/.DS_Store
|
147
|
+
- lib/prometheus.rb
|
148
|
+
- lib/prometheus/.DS_Store
|
149
|
+
- lib/prometheus/client.rb
|
150
|
+
- lib/prometheus/client/configuration.rb
|
151
|
+
- lib/prometheus/client/counter.rb
|
152
|
+
- lib/prometheus/client/formats/protobuf.rb
|
153
|
+
- lib/prometheus/client/formats/text.rb
|
154
|
+
- lib/prometheus/client/gauge.rb
|
155
|
+
- lib/prometheus/client/helper/entry_parser.rb
|
156
|
+
- lib/prometheus/client/helper/file_locker.rb
|
157
|
+
- lib/prometheus/client/helper/json_parser.rb
|
158
|
+
- lib/prometheus/client/helper/metrics_processing.rb
|
159
|
+
- lib/prometheus/client/helper/metrics_representation.rb
|
160
|
+
- lib/prometheus/client/helper/mmaped_file.rb
|
161
|
+
- lib/prometheus/client/helper/plain_file.rb
|
162
|
+
- lib/prometheus/client/histogram.rb
|
163
|
+
- lib/prometheus/client/label_set_validator.rb
|
164
|
+
- lib/prometheus/client/metric.rb
|
165
|
+
- lib/prometheus/client/mmaped_dict.rb
|
166
|
+
- lib/prometheus/client/mmaped_value.rb
|
167
|
+
- lib/prometheus/client/page_size.rb
|
168
|
+
- lib/prometheus/client/push.rb
|
169
|
+
- lib/prometheus/client/rack/collector.rb
|
170
|
+
- lib/prometheus/client/rack/exporter.rb
|
171
|
+
- lib/prometheus/client/registry.rb
|
172
|
+
- lib/prometheus/client/simple_value.rb
|
173
|
+
- lib/prometheus/client/summary.rb
|
174
|
+
- lib/prometheus/client/support/puma.rb
|
175
|
+
- lib/prometheus/client/support/unicorn.rb
|
176
|
+
- lib/prometheus/client/uses_value_type.rb
|
177
|
+
- lib/prometheus/client/version.rb
|
178
|
+
homepage: https://gitlab.com/gitlab-org/prometheus-client-mmap
|
179
|
+
licenses:
|
180
|
+
- Apache-2.0
|
181
|
+
metadata:
|
182
|
+
allowed_push_host: https://rubygems.org
|
183
|
+
post_install_message:
|
184
|
+
rdoc_options: []
|
185
|
+
require_paths:
|
186
|
+
- lib
|
187
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
188
|
+
requirements:
|
189
|
+
- - ">="
|
190
|
+
- !ruby/object:Gem::Version
|
191
|
+
version: 2.7.0
|
192
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
193
|
+
requirements:
|
194
|
+
- - ">="
|
195
|
+
- !ruby/object:Gem::Version
|
196
|
+
version: '0'
|
197
|
+
requirements: []
|
198
|
+
rubygems_version: 3.4.19
|
199
|
+
signing_key:
|
200
|
+
specification_version: 4
|
201
|
+
summary: A suite of instrumentation metric primitives that can be exposed through
|
202
|
+
a web services interface.
|
203
|
+
test_files: []
|