sensu-plugins-postgres 1.4.1 → 1.4.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
  SHA1:
3
- metadata.gz: 993dcdf3196f64eb952b83e149dcf97aa8c1c3b4
4
- data.tar.gz: e4429c8ddeeaf0e2aadd7dc23eb6feb4b1facf2b
3
+ metadata.gz: e9eb754d56e7a8ade27af0fb36aeb08d0f3633e9
4
+ data.tar.gz: ad88363188072fcb94db781a5572d52f6cb50b84
5
5
  SHA512:
6
- metadata.gz: dfcaabcfab68526a0328e55e97724951303dfa65badc6af5bd15716a1b16c22c682e6d2214d17e1765a90a583ff18d23c3f5ded627ae508ff1c6cd79795a5c69
7
- data.tar.gz: 2ceaba039d8ba6b1bcf4de1050811a512b75e3e6d93096fa52ad7138d54f28da76d0e94839c411d5359a89f600f06006ba530f0c3c7b19f0eabb6f3999a58d8c
6
+ metadata.gz: affc3257c83dff3ec5c102329e999e3d8a3c61f0ca15fac497d79507683d91cb163103970d90a985602bb9f277cee18bc2ed24679b51b529ff26dfc062413899
7
+ data.tar.gz: 4ec0f25b880fbd08427d4d55b508611b12ae7a6fd27922045c3fe2bfbf062a115639db3f05f38c7c3890c594351beba08447d271e979827ef1066ecdeee0dabf
data/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [1.4.2] - 2017-09-27
9
+ ### Fixed
10
+ - metric-postgres-locks.rb: Fix lock count collection (@madboxkr)
11
+
8
12
  ## [1.4.1] - 2017-09-26
9
13
  ### Fixed
10
14
  - metrics-postgres-query.rb: Add a nil check to avoid failure when the query result is empty (@eheydrick)
@@ -118,7 +122,8 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
118
122
  ### Added
119
123
  - initial release
120
124
 
121
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/1.4.1...HEAD
125
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/1.4.2...HEAD
126
+ [1.4.2]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/1.4.1...1.4.2
122
127
  [1.4.1]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/1.4.0...1.4.1
123
128
  [1.4.0]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/1.3.0...1.4.0
124
129
  [1.3.0]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/1.2.0...1.3.0
@@ -90,15 +90,15 @@ class PostgresStatsDBMetrics < Sensu::Plugin::Metric::CLI::Graphite
90
90
  port: config[:port],
91
91
  connect_timeout: config[:timeout])
92
92
  request = [
93
- 'SELECT mode, count(mode) FROM pg_locks',
94
- "where database = (select oid from pg_database where datname = '#{config[:database]}')",
95
- 'group by mode'
93
+ 'SELECT mode, count(mode) AS count FROM pg_locks',
94
+ "WHERE database = (SELECT oid FROM pg_database WHERE datname = '#{config[:database]}')",
95
+ 'GROUP BY mode'
96
96
  ]
97
97
 
98
98
  con.exec(request.join(' ')) do |result|
99
99
  result.each do |row|
100
100
  lock_name = row['mode'].downcase.to_sym
101
- locks_per_type[lock_name] += 1
101
+ locks_per_type[lock_name] = row['count']
102
102
  end
103
103
  end
104
104
 
@@ -2,7 +2,7 @@ module SensuPluginsPostgres
2
2
  module Version
3
3
  MAJOR = 1
4
4
  MINOR = 4
5
- PATCH = 1
5
+ PATCH = 2
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-postgres
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors