prometheus-client 0.3.0 → 0.3.1
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
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDk0MDcwZDZiNTAzOWQ4M2M1ZTQ3MzI0MzVmYTU4OThkMTc4MWFhZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDI0OThmMTY0ZDMzNGY3N2UzMTExODRjOWEwNDc3ZWEzMzZmNmNlZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTE3ZGQ1ZjIyYWFlZTJiNzQ2MWFjY2Y5ZTZlMTA0NWJkMmZkNWRkYzAwZDM0
|
10
|
+
NWVlYzQ2YjgyMDUxZDIyZDBkMmY4N2EzZWEwZDc5NmQ5Zjc2M2M1MzAyZjg3
|
11
|
+
YzRhMzQyMTYwMWYzM2Q3YzJkMzExYWRmYmEwZjI0NjM3YmU2Mjk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTFjMzU5NDA3N2VjMTM4Y2Q4MDZiOGM3MTU1YWYwZmI0YTY0MjQxMTUyNDg5
|
14
|
+
NGJjMTQyZGFkNDQ5NmE3NzE3NWYyYzAzODMwMzNiOThjMzBlZTA5N2U2ZWI0
|
15
|
+
OTA5M2MwMjcwMzI1ZWU2Y2MyMTk4ZDExY2I2NmU4OTY2ZjU5YWE=
|
@@ -20,12 +20,12 @@ module Prometheus
|
|
20
20
|
@app = app
|
21
21
|
@registry = options[:registry] || Client.registry
|
22
22
|
@path = options[:path] || '/metrics'
|
23
|
-
@
|
23
|
+
@acceptable = build_dictionary(FORMATS, FALLBACK)
|
24
24
|
end
|
25
25
|
|
26
26
|
def call(env)
|
27
27
|
if env['PATH_INFO'] == @path
|
28
|
-
format = negotiate(env['HTTP_ACCEPT'], @
|
28
|
+
format = negotiate(env['HTTP_ACCEPT'], @acceptable)
|
29
29
|
format ? respond_with(format) : not_acceptable(FORMATS)
|
30
30
|
else
|
31
31
|
@app.call(env)
|
@@ -34,8 +34,8 @@ module Prometheus
|
|
34
34
|
|
35
35
|
private
|
36
36
|
|
37
|
-
def negotiate(accept, formats
|
38
|
-
|
37
|
+
def negotiate(accept, formats)
|
38
|
+
accept = '*/*' if accept.to_s.empty?
|
39
39
|
|
40
40
|
parse(accept).each do |content_type, _|
|
41
41
|
return formats[content_type] if formats.key?(content_type)
|
@@ -81,8 +81,8 @@ module Prometheus
|
|
81
81
|
]
|
82
82
|
end
|
83
83
|
|
84
|
-
def build_dictionary(formats)
|
85
|
-
formats.each_with_object(
|
84
|
+
def build_dictionary(formats, fallback)
|
85
|
+
formats.each_with_object('*/*' => fallback) do |format, memo|
|
86
86
|
memo[format::CONTENT_TYPE] = format
|
87
87
|
memo[format::MEDIA_TYPE] = format
|
88
88
|
end
|
@@ -15,11 +15,9 @@ module Prometheus
|
|
15
15
|
def initialize(estimator)
|
16
16
|
@sum, @total = estimator.sum, estimator.observations
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
estimator.invariants.each do |invariant|
|
19
|
+
self[invariant.quantile] = estimator.query(invariant.quantile)
|
20
20
|
end
|
21
|
-
|
22
|
-
replace(values)
|
23
21
|
end
|
24
22
|
end
|
25
23
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prometheus-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Schmidt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: quantile
|