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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a79fefae7129536931c001b64ac33fb5b90408c3fc49438e34f010eaf29008e0
4
- data.tar.gz: 1920f31e7dc66ab9475a8e983c1ab56dcff685c2c108bad680b01134211f2d6e
3
+ metadata.gz: c50481a86da83ef0d570c77a11d24caef01d0053e5414769ef2db57d6ce633b0
4
+ data.tar.gz: 1afe0060aa7fc70d8183b234e583cceac4cf7e9b9a938ed8f77a7caaa9fbad01
5
5
  SHA512:
6
- metadata.gz: 5a64ec99b4f27f44308a264aa46cf566b9076ca7e1ee5d183471025c97d2c9677bd85b0a7eface7bf00d0412fdb33416829426d0471829f0268c3d36d98c8eea
7
- data.tar.gz: fdeafb8d1d3659a9922ced4af5f20710775d52577557d7881bc8357e9e67bcf70fc7953c9f8729973b74d908af3580b9ec0d0aa8be41a88111e4c3c3d078640c
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.com/senid231/pgq_prometheus.svg?branch=master)](https://travis-ci.com/senid231/pgq_prometheus)
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/senid231/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/senid231/pgq_prometheus/blob/master/CODE_OF_CONDUCT.md).
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/senid231/pgq_prometheus/blob/master/CODE_OF_CONDUCT.md).
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgqPrometheus
4
- VERSION = '0.2.1'
4
+ VERSION = '0.2.2'
5
5
  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/senid231/pgq_prometheus'
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.1
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-04 00:00:00.000000000 Z
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/senid231/pgq_prometheus
65
+ homepage: https://github.com/didww/pgq_prometheus
66
66
  licenses:
67
67
  - MIT
68
68
  metadata:
69
- homepage_uri: https://github.com/senid231/pgq_prometheus
70
- source_code_uri: https://github.com/senid231/pgq_prometheus
71
- changelog_uri: https://github.com/senid231/pgq_prometheus
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: