prometheus-client-mmap 1.7.1 → 1.7.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/README.md +6 -5
- data/lib/prometheus/client/formats/text.rb +5 -7
- data/lib/prometheus/client/rack/exporter.rb +1 -1
- data/lib/prometheus/client/summary.rb +8 -10
- data/lib/prometheus/client/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: 4503b14fb2d97e4fbd1bed4ddb1d37d34a0afdba74b75f038103d21cf3042194
|
|
4
|
+
data.tar.gz: 40d3335f7ce24e60675af78ccbc9eef3bd0d5cfca48e1d1bddcbf93464ce848e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6337982b5065d19fc6bbe4cf81c4441bf8ec26fef77d23660660afb8240b0a52fb502dc7806bcfc7263b1dbcc335d16eb81337b03bb54872d29548b2f1f2b2bf
|
|
7
|
+
data.tar.gz: 1e463661bd0127dc750afbcf677743cb37fe107672356a4e1f24ca86eaa6bf85453293ba5fd39541e7667e5319da5be27db530704e48acbe6160d88cff769798
|
data/README.md
CHANGED
|
@@ -8,7 +8,7 @@ A suite of instrumentation metric primitives for Ruby that can be exposed
|
|
|
8
8
|
through a HTTP interface. Intended to be used together with a
|
|
9
9
|
[Prometheus server][1].
|
|
10
10
|
|
|
11
|
-
[![Gem Version][4]](
|
|
11
|
+
[![Gem Version][4]](https://badge.fury.io/rb/prometheus-client-mmap)
|
|
12
12
|
[![Build Status][3]](https://gitlab.com/gitlab-org/prometheus-client-mmap/commits/master)
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
@@ -186,7 +186,8 @@ histogram.get({ service: 'users' })
|
|
|
186
186
|
### Summary
|
|
187
187
|
|
|
188
188
|
Summary, similar to histograms, is an accumulator for samples. It captures
|
|
189
|
-
Numeric data and
|
|
189
|
+
Numeric data and keeps the sum and the count of the observations, exported as
|
|
190
|
+
`<name>_sum` and `<name>_count`. It does not calculate quantiles.
|
|
190
191
|
|
|
191
192
|
```ruby
|
|
192
193
|
summary = Prometheus::Client::Summary.new(:service_latency_seconds, '...')
|
|
@@ -194,9 +195,9 @@ summary = Prometheus::Client::Summary.new(:service_latency_seconds, '...')
|
|
|
194
195
|
# record a value
|
|
195
196
|
summary.observe({ service: 'database' }, Benchmark.realtime { service.call() })
|
|
196
197
|
|
|
197
|
-
# retrieve the
|
|
198
|
+
# retrieve the sum of the recorded values for a given label set
|
|
198
199
|
summary.get({ service: 'database' })
|
|
199
|
-
# =>
|
|
200
|
+
# => 5.3428231
|
|
200
201
|
```
|
|
201
202
|
|
|
202
203
|
## Configuration
|
|
@@ -275,7 +276,7 @@ pipeline for the tag completes.
|
|
|
275
276
|
[1]: https://github.com/prometheus/prometheus
|
|
276
277
|
[2]: http://rack.github.io/
|
|
277
278
|
[3]: https://gitlab.com/gitlab-org/prometheus-client-mmap/badges/master/pipeline.svg
|
|
278
|
-
[4]: https://badge.fury.io/rb/prometheus-client.svg
|
|
279
|
+
[4]: https://badge.fury.io/rb/prometheus-client-mmap.svg
|
|
279
280
|
[8]: https://github.com/prometheus/pushgateway
|
|
280
281
|
[9]: lib/prometheus/client/rack/exporter.rb
|
|
281
282
|
[10]: lib/prometheus/client/rack/collector.rb
|
|
@@ -57,14 +57,12 @@ module Prometheus
|
|
|
57
57
|
end
|
|
58
58
|
end
|
|
59
59
|
|
|
60
|
+
# Summary::Value keeps no quantiles, only the sum and the count.
|
|
60
61
|
def summary(name, set, value)
|
|
61
|
-
|
|
62
|
-
[name, set
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
rv << ["#{name}_sum", set, value.get.sum]
|
|
66
|
-
rv << ["#{name}_count", set, value.get.total]
|
|
67
|
-
rv
|
|
62
|
+
[
|
|
63
|
+
["#{name}_sum", set, value.sum.get],
|
|
64
|
+
["#{name}_count", set, value.total.get],
|
|
65
|
+
]
|
|
68
66
|
end
|
|
69
67
|
|
|
70
68
|
def histogram(name, set, value)
|
|
@@ -4,7 +4,8 @@ require 'prometheus/client/uses_value_type'
|
|
|
4
4
|
module Prometheus
|
|
5
5
|
module Client
|
|
6
6
|
# Summary is an accumulator for samples. It captures Numeric data and
|
|
7
|
-
#
|
|
7
|
+
# keeps the sum and the count of the observations. It does not
|
|
8
|
+
# calculate quantiles.
|
|
8
9
|
class Summary < Metric
|
|
9
10
|
extend Gem::Deprecate
|
|
10
11
|
|
|
@@ -22,6 +23,12 @@ module Prometheus
|
|
|
22
23
|
@sum.increment(value)
|
|
23
24
|
@total.increment
|
|
24
25
|
end
|
|
26
|
+
|
|
27
|
+
# Returns the sum of the observations, as Summary#get does for this
|
|
28
|
+
# label set.
|
|
29
|
+
def get
|
|
30
|
+
@sum.get
|
|
31
|
+
end
|
|
25
32
|
end
|
|
26
33
|
|
|
27
34
|
def initialize(name, docstring, base_labels = {})
|
|
@@ -50,15 +57,6 @@ module Prometheus
|
|
|
50
57
|
end
|
|
51
58
|
end
|
|
52
59
|
|
|
53
|
-
# Returns all label sets with their values
|
|
54
|
-
def values
|
|
55
|
-
synchronize do
|
|
56
|
-
@values.each_with_object({}) do |(labels, value), memo|
|
|
57
|
-
memo[labels] = value.sum
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
|
|
62
60
|
private
|
|
63
61
|
|
|
64
62
|
def default(labels)
|