emrb 0.1.0 → 0.1.2
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/example/http/Gemfile.lock +1 -1
- data/example/push/Gemfile.lock +1 -1
- data/lib/emrb/ext/prometheus.rb +9 -0
- data/lib/emrb/instruments/instruments.rb +3 -3
- data/lib/emrb/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f15f9f402475d30026e70a8cce75b215795571fce2f9dcd4136bf1dba606531c
|
4
|
+
data.tar.gz: e067cdaeed6f55961b1575092eb568bda41ac599b076ae43f2e4d6dee6573ba6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c1b89985d30211a1d78c1243ad8ca36cd20147230c93ee19140e2ad79dbff05655c1ca973f56936544ca9f446bb550e1036acebfdf12457831de7783ca2fe8d
|
7
|
+
data.tar.gz: bb6f9946b27080c769f5a9d258e5385548d1a043aed15c1b4d1f97cf1bef95d271a75b9c95c5056a8196743ff3f9f9b7dee7e57f95de2f49db2cd81770b021a7
|
data/example/http/Gemfile.lock
CHANGED
data/example/push/Gemfile.lock
CHANGED
data/lib/emrb/ext/prometheus.rb
CHANGED
@@ -19,6 +19,15 @@ module Prometheus
|
|
19
19
|
# that can be used for implementing facilities.
|
20
20
|
class Histogram
|
21
21
|
alias obs observe
|
22
|
+
|
23
|
+
def measure(**, &)
|
24
|
+
raise LocalJumpError, "no block given" unless block_given?
|
25
|
+
|
26
|
+
now = Time.now
|
27
|
+
yield
|
28
|
+
ensure
|
29
|
+
obs(Time.now - now, **)
|
30
|
+
end
|
22
31
|
end
|
23
32
|
|
24
33
|
# Internal: Extension of Prometheus::Client::Summary
|
@@ -70,7 +70,7 @@ module Emrb
|
|
70
70
|
# For a full list of options and functionalities for creating and utilizing a Gauge,
|
71
71
|
# refer to the Prometheus client documentation:
|
72
72
|
# https://github.com/prometheus/client_ruby?tab=readme-ov-file#gauge
|
73
|
-
def gauge(identifier, docs, **, &)
|
73
|
+
def gauge(identifier, docs = "...", **, &)
|
74
74
|
check_identifier!(identifier)
|
75
75
|
opts = block_opts(**, &)
|
76
76
|
State.gauge(id_for(identifier), docs, **opts).tap do |g|
|
@@ -108,7 +108,7 @@ module Emrb
|
|
108
108
|
# For all available options and functionalities for creating and utilizing a Histogram,
|
109
109
|
# refer to the Prometheus client documentation:
|
110
110
|
# https://github.com/prometheus/client_ruby?tab=readme-ov-file#histogram
|
111
|
-
def histogram(identifier, docs, **, &)
|
111
|
+
def histogram(identifier, docs = "...", **, &)
|
112
112
|
check_identifier!(identifier)
|
113
113
|
opts = block_opts(**, &)
|
114
114
|
State.histogram(id_for(identifier), docs, **opts).tap do |h|
|
@@ -139,7 +139,7 @@ module Emrb
|
|
139
139
|
# For a complete list of options and functionalities for creating and utilizing a Summary,
|
140
140
|
# refer to the Prometheus client documentation:
|
141
141
|
# https://github.com/prometheus/client_ruby?tab=readme-ov-file#summary
|
142
|
-
def summary(identifier, docs, **, &)
|
142
|
+
def summary(identifier, docs = "...", **, &)
|
143
143
|
check_identifier!(identifier)
|
144
144
|
opts = block_opts(**, &)
|
145
145
|
State.summary(id_for(identifier), docs, **opts).tap do |s|
|
data/lib/emrb/version.rb
CHANGED