sensu-plugins-postgres 0.1.0 → 0.1.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
- MjY5MTU2MzcxODk3OWIzNDcyZGQxOTdmMGYyODFhOWM2Mjc1ZGFkMA==
4
+ OTIyN2VhZjQwMWZhNzhlOGZjZDUyYjI4MWFiYmIzZGRhNGFmYzNiZA==
5
5
  data.tar.gz: !binary |-
6
- MTQ2NzVmMGZjYzg2NmE2NmUxOGI1NjY3NWI0YjRiZjM2N2JiZTUxMA==
6
+ NDQ4ZGVhOGZlZDQ4MTFkZjdmMjU2NzgxNDM5YWUwNWMyYjNmNDEyNQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Zjk3MTExMzQ0MGQwMTAzNjFhNTBlMTY5Zjc4YmFmZDA0OGNkZGEyNmMzMWFm
10
- NjZlYjZlNjMyZTgyM2ZhYTAxMmQ2OTIxNjNjYjE2YzljMzVlYzViMWFlNWQ2
11
- ZjAxMzIxY2MyYmYzZjBkNzU4YzE3YmViNzUxMmEyYjE2MjQ5YjU=
9
+ MzczNThmZmYwOGQwZDlkYzNmMjdhMjI2YzExNmNjYzdlMjNiZjhjMjc0MWYy
10
+ MTc0NjQxNjk1MWQyZGY5Mzg5YzdiOGZmNTViMjJhMmQ3MGM3ZTgzOWY1NWFj
11
+ YWFhZjQwNDFhYmRmYzY3NmMzYTY4ZTk3YTVkMWQ5ZWYyNDVmMjM=
12
12
  data.tar.gz: !binary |-
13
- ZWY2MjNjNjU5OWVjODA2MTZmOTIzODQ5ZTNjMmQ2NzViYWNiODk5YzE4NTFi
14
- Y2RlZmQ4NWE2Njc1NzJhMTQ4ZTkzMDdkMmJlN2Y5ZWQxNTg3YjU0ZDk0MTE5
15
- MDFhZjUxYWYwZDJlZTdlMzhjN2Y1YTc4OTQ0OTgwODI0OTkxNDE=
13
+ MzY3Y2MwNzk1YWFkMjE2NWM3ZGM4N2Q5NDExMmNmMzk1ZGZlMTQ5OGUyOTg4
14
+ N2RkODA1ZGNlMzg5MGI1MTZjZGY3MTgyNDk2MWFlMjFlMTJmNzc1ODhhOTRm
15
+ NTc1ZTEwNjE5M2I4N2YxNjg2MzdlOTUxN2NkNjk1ZmNhZjczZjE=
data/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [0.1.1] - 2016-03-24
9
+ ### Added
10
+ - metric-postgres-connections: Add new metric `total`
11
+
12
+ ### Fixed
13
+ - metric-postgres-connections: Correctly evaluate and collect metrics for active connections and active connections waiting on backend locks
14
+
8
15
  ## [0.1.0] - 2016-03-09
9
16
  ### Added
10
17
  - Add new plugin `check-postgres-connections` that checks the number of connections to a DB
@@ -77,18 +77,21 @@ class PostgresStatsDBMetrics < Sensu::Plugin::Metric::CLI::Graphite
77
77
 
78
78
  metrics = {
79
79
  active: 0,
80
- waiting: 0
80
+ waiting: 0,
81
+ total: 0
81
82
  }
82
83
  con.exec(request.join(' ')) do |result|
83
84
  result.each do |row|
84
- if row['waiting']
85
+ if row['waiting'] == 't'
85
86
  metrics[:waiting] = row['count']
86
- else
87
+ elsif row['waiting'] == 'f'
87
88
  metrics[:active] = row['count']
88
89
  end
89
90
  end
90
91
  end
91
92
 
93
+ metrics[:total] = (metrics[:waiting].to_i + metrics[:active].to_i)
94
+
92
95
  metrics.each do |metric, value|
93
96
  output "#{config[:scheme]}.connections.#{config[:db]}.#{metric}", value, timestamp
94
97
  end
@@ -2,7 +2,7 @@ module SensuPluginsPostgres
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- PATCH = 0
5
+ PATCH = 1
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-postgres
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-09 00:00:00.000000000 Z
11
+ date: 2016-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin