pgq_prometheus 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/pgq_prometheus/collector.rb +5 -0
- data/lib/pgq_prometheus/version.rb +1 -1
- data/pgq_prometheus_metrics.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c50481a86da83ef0d570c77a11d24caef01d0053e5414769ef2db57d6ce633b0
|
4
|
+
data.tar.gz: 1afe0060aa7fc70d8183b234e583cceac4cf7e9b9a938ed8f77a7caaa9fbad01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 988676417dfad5594adf5d356b3dccc5d5a9a4f4197b9b97b65bbe1fdb45a768120ef6cc5ce4ec81d9b09866c9ef0807114321f3c9ae7ce164ab550e868d82a2
|
7
|
+
data.tar.gz: 33d063934622c01cd674a957a09001e5428025159e14d7e15e41dce6472d6f992dcee6203c1288a4ba391f3234bf2bc42245429a20dafece24738108a9506cf8
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# PgqPrometheus
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.
|
3
|
+
[![Build Status](https://travis-ci.org/didww/pgq_prometheus.svg?branch=master)](https://travis-ci.org/didww/pgq_prometheus)
|
4
4
|
|
5
5
|
Highly configurable Prometheus metrics for PGQ postgres extension
|
6
6
|
|
@@ -105,7 +105,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
105
105
|
|
106
106
|
## Contributing
|
107
107
|
|
108
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
108
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/didww/pgq_prometheus. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/didww/pgq_prometheus/blob/master/CODE_OF_CONDUCT.md).
|
109
109
|
|
110
110
|
|
111
111
|
## License
|
@@ -114,4 +114,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
114
114
|
|
115
115
|
## Code of Conduct
|
116
116
|
|
117
|
-
Everyone interacting in the PgqPrometheus project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
117
|
+
Everyone interacting in the PgqPrometheus project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/didwwpgq_prometheus/blob/master/CODE_OF_CONDUCT.md).
|
@@ -5,6 +5,7 @@ require 'prometheus_exporter/server'
|
|
5
5
|
|
6
6
|
module PgqPrometheus
|
7
7
|
class Collector < PrometheusExporter::Server::TypeCollector
|
8
|
+
MAX_METRIC_AGE = 30
|
8
9
|
|
9
10
|
def initialize
|
10
11
|
@data = []
|
@@ -48,6 +49,10 @@ module PgqPrometheus
|
|
48
49
|
end
|
49
50
|
|
50
51
|
def collect(obj)
|
52
|
+
now = ::Process.clock_gettime(::Process::CLOCK_MONOTONIC)
|
53
|
+
|
54
|
+
obj['created_at'] = now
|
55
|
+
@data.delete_if { |m| m['created_at'] + MAX_METRIC_AGE < now }
|
51
56
|
@data << obj
|
52
57
|
end
|
53
58
|
end
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
|
11
11
|
spec.summary = 'Prometheus metrics for PGQ postgres extension'
|
12
12
|
spec.description = 'Prometheus metrics for PGQ postgres extension'
|
13
|
-
spec.homepage = 'https://github.com/
|
13
|
+
spec.homepage = 'https://github.com/didww/pgq_prometheus'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
|
16
16
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pgq_prometheus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Talakevich
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: prometheus_exporter
|
@@ -62,13 +62,13 @@ files:
|
|
62
62
|
- lib/pgq_prometheus/sql_caller/active_record.rb
|
63
63
|
- lib/pgq_prometheus/version.rb
|
64
64
|
- pgq_prometheus_metrics.gemspec
|
65
|
-
homepage: https://github.com/
|
65
|
+
homepage: https://github.com/didww/pgq_prometheus
|
66
66
|
licenses:
|
67
67
|
- MIT
|
68
68
|
metadata:
|
69
|
-
homepage_uri: https://github.com/
|
70
|
-
source_code_uri: https://github.com/
|
71
|
-
changelog_uri: https://github.com/
|
69
|
+
homepage_uri: https://github.com/didww/pgq_prometheus
|
70
|
+
source_code_uri: https://github.com/didww/pgq_prometheus
|
71
|
+
changelog_uri: https://github.com/didww/pgq_prometheus
|
72
72
|
post_install_message:
|
73
73
|
rdoc_options: []
|
74
74
|
require_paths:
|