newrelic_postgres_plugin 0.2.2 → 0.2.3

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 46827fee5b2739c2cd1307f0081fc1cd33ae45d5
4
- data.tar.gz: fb4bab91b8455254a5d3539e96361d9ad045796b
3
+ metadata.gz: df49884a5a752bb2515da8bacbaa3d2e5c946483
4
+ data.tar.gz: aadb0a56547d98b2a940c545a563744e334420c4
5
5
  SHA512:
6
- metadata.gz: 35e1c25f6da0aef46ddd8a6b59323490ff9c9aea0d55f8a78ab177e58fa7e8edaf22f300c119d43149de52dbb70ba7afa36cec969f33e17b23ddc4a12ab20245
7
- data.tar.gz: 220bf38e85a87e61107e2cf3ad687abad2e81af6fe5953bb5341b2710a12697323817a8cdd92f7b65c7bc8282e93d0259d559eb5d116f707e41a40995ec2d422
6
+ metadata.gz: cfd61c6982580ef02ffaa5609377849c7a33df7751dd230a7fd44f315323f4ea7dfd70cb44d91364218fa60e38443fd1dd3027c6bfc355d2929436ae605cc2b6
7
+ data.tar.gz: 1dd6eed77a06076bc83c03b3c918a2fd6370750039635d921d07d7377221a04a95bc8f43d8e953af346c9055aa5f2c39df2c845198c35a0a6527e5b61c06ad3e
@@ -61,6 +61,7 @@ module NewRelic::PostgresPlugin
61
61
  report_database_metrics
62
62
  report_index_metrics
63
63
  report_cache_metrics
64
+ report_qps_metrics
64
65
 
65
66
  rescue => e
66
67
  $stderr.puts "#{e}: #{e.backtrace.join("\n ")}"
@@ -121,6 +122,10 @@ module NewRelic::PostgresPlugin
121
122
  report_metric "Cache/Miss Ratio", '%', calculate_miss_ratio(%Q{SELECT SUM(heap_blks_hit) AS hits, SUM(heap_blks_read) AS reads FROM pg_statio_user_tables})
122
123
  end
123
124
 
125
+ def report_qps_metrics
126
+ report_derived_metric "Database/Queries/Count", '', @connection.exec("SELECT SUM(calls) FROM pg_stat_statements")[0]["sum"].to_i
127
+ end
128
+
124
129
  private
125
130
 
126
131
  # This assumes the query returns a single row with two columns: hits and reads.
@@ -1,3 +1,3 @@
1
1
  module NewRelic::PostgresPlugin
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'newrelic_postgres_plugin'
16
- s.version = '0.2.2'
16
+ s.version = '0.2.3'
17
17
  s.date = '2014-08-05'
18
18
  s.rubyforge_project = 'newrelic_postgres_plugin'
19
19
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic_postgres_plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Hodgson