frankenstein 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/frankenstein/request.rb +4 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ba12d5e4ad9e76a2bec62028b14952b2081b7ea16dbabf00eb14eb1db4b0ab6
4
- data.tar.gz: 23d575919475820563f308fdb335e16089eb981c2350c3484e191330fc74d90d
3
+ metadata.gz: 7363ffd1bb284a1a47e23c7a7fa1e89612952047d58144cc91401d968dec399a
4
+ data.tar.gz: 3e66a088f9d2caec619e83ffba869b85b80f6d68c7c3cd4da4526fb207ca3b54
5
5
  SHA512:
6
- metadata.gz: 6e8286ddd22170784525f2f81e76a0ff646e0ae91318539fb6fafac71c6fab537ffcdc33be5756ef048a16ea220a5ef5ce182c2ac5ab5dbdc956e4fd8d079676
7
- data.tar.gz: f35c4da5e96629af26b9a49f47c4a639d3199025a437e63ab2ecd2f1ff2364529774935879f5c3014422e565aed4710727737848912cb1dc467b924f0f421248
6
+ metadata.gz: 6fdd13584efd78d31381c27fcf2a822628945a55fe4a4b9280504811bfef4fd21adfa331fc83e21a2706ffc29fd13166aac0605b4dbc4f5eda3a746e60b61abd
7
+ data.tar.gz: d634e303dd93edbf060542c3d05a3ce985d3d8c0c1d06bed597e573f578ac338846dde2e117648107d7419ca6ed7ffc30c1d5a96c844d5f33d77a40648688f70
@@ -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.0.0
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-01 00:00:00.000000000 Z
11
+ date: 2020-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prometheus-client