frankenstein 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/frankenstein/request.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7363ffd1bb284a1a47e23c7a7fa1e89612952047d58144cc91401d968dec399a
|
4
|
+
data.tar.gz: 3e66a088f9d2caec619e83ffba869b85b80f6d68c7c3cd4da4526fb207ca3b54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fdd13584efd78d31381c27fcf2a822628945a55fe4a4b9280504811bfef4fd21adfa331fc83e21a2706ffc29fd13166aac0605b4dbc4f5eda3a746e60b61abd
|
7
|
+
data.tar.gz: d634e303dd93edbf060542c3d05a3ce985d3d8c0c1d06bed597e573f578ac338846dde2e117648107d7419ca6ed7ffc30c1d5a96c844d5f33d77a40648688f70
|
data/lib/frankenstein/request.rb
CHANGED
@@ -80,10 +80,10 @@ module Frankenstein
|
|
80
80
|
# want `stats_server.registry`.
|
81
81
|
#
|
82
82
|
def initialize(prefix, labels: [], duration_labels: nil, outgoing: true, description: prefix, registry: Prometheus::Client.registry)
|
83
|
-
@requests = registry.counter(:"#{prefix}_requests_total", docstring: "Number of #{description} requests #{outgoing ? 'sent' : 'received'}", labels: labels)
|
84
|
-
@durations = registry.histogram(:"#{prefix}_request_duration_seconds", docstring: "Time taken to #{outgoing ? 'receive' : 'send'} a #{description} response", labels: duration_labels || labels)
|
85
|
-
@exceptions = registry.counter(:"#{prefix}_exceptions_total", docstring: "Number of exceptions raised by the #{description} code", labels: labels + [:class])
|
86
|
-
@current = registry.gauge(:"#{prefix}_in_progress_count", docstring: "Number of #{description} requests currently in progress", labels: labels)
|
83
|
+
@requests = registry.get(:"#{prefix}_requests_total") || registry.counter(:"#{prefix}_requests_total", docstring: "Number of #{description} requests #{outgoing ? 'sent' : 'received'}", labels: labels)
|
84
|
+
@durations = registry.get(:"#{prefix}_request_duration_seconds") || registry.histogram(:"#{prefix}_request_duration_seconds", docstring: "Time taken to #{outgoing ? 'receive' : 'send'} a #{description} response", labels: duration_labels || labels)
|
85
|
+
@exceptions = registry.get(:"#{prefix}_exceptions_total") || registry.counter(:"#{prefix}_exceptions_total", docstring: "Number of exceptions raised by the #{description} code", labels: labels + [:class])
|
86
|
+
@current = registry.get(:"#{prefix}_in_progress_count") || registry.gauge(:"#{prefix}_in_progress_count", docstring: "Number of #{description} requests currently in progress", labels: labels)
|
87
87
|
|
88
88
|
# Prometheus::Client::Gauge doesn't (yet) have a built-in way to
|
89
89
|
# atomically "adjust" a gauge, only get the current value and set a
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: frankenstein
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Palmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: prometheus-client
|