pghero 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pghero might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 445cd3bca08cacab61c7fbf4d6f910905cb28677
4
- data.tar.gz: 22a7465af2781805eeafb47cd8208283a82f460f
3
+ metadata.gz: 29304eb8bb67300583bfaaffab77dd935b0130ff
4
+ data.tar.gz: 25e21952cdc181790541aebfa0ff0367185f2310
5
5
  SHA512:
6
- metadata.gz: e107fd5f5edab6f689ae6cf7643820ef36d57364f06e9af6926a99d2c41db0f4cdcafaa38cbaf7492b724f5c966bffc8b9052f0e4ae93c5e998e597b85af1782
7
- data.tar.gz: 2716c641985e431380c0162127d66be3cb473d7089678735482ebe188132a22de0d308a084cdbacea61290dbdad876ea02b6196b6dea0931e3c6a8ad640dbd73
6
+ metadata.gz: c4e5849bd8c6cf15d02012be6319353d5239a479de435250273a0abd36cef5e277f4cc9ba4b5408d0508a7990d0839ca47cadd06e6c8b47cb46d26ddd7ea85c6
7
+ data.tar.gz: 74edd4e2ac1432ad5793a01ed727c95915563f45bfe7637d0344eb6b32a3ddedd7128f273be91235b4f165c0da59fb2f34ee08b4ab77e004d61108ecfcaeeb0a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.1.3
2
+
3
+ - Reverted `query_stats_available?` fix
4
+
1
5
  ## 0.1.2
2
6
 
3
7
  - Fixed `query_stats_available?` method
data/README.md CHANGED
@@ -45,6 +45,14 @@ PgHero.table_hit_rate
45
45
  # kill queries
46
46
  PgHero.kill(pid)
47
47
  PgHero.kill_all
48
+
49
+ # query stats
50
+ PgHero.query_stats_enabled?
51
+ PgHero.enable_query_stats
52
+ PgHero.disable_query_stats
53
+ PgHero.reset_query_stats
54
+ PgHero.query_stats
55
+ PgHero.slow_queries
48
56
  ```
49
57
 
50
58
  ## Security
@@ -47,15 +47,15 @@
47
47
 
48
48
  <% if !@query_stats_enabled %>
49
49
  <div class="content">
50
- <h1>Query Statistics</h1>
50
+ <h1>Query Stats</h1>
51
51
 
52
52
  <% if @query_stats_available %>
53
53
  <p>
54
- Query statistics are available but not enabled.
54
+ Query stats are available but not enabled.
55
55
  <%= button_to "Enable", enable_query_stats_path, class: "btn btn-info" %>
56
56
  </p>
57
57
  <% elsif @rds %>
58
- <p>Query statistics are not available on Amazon RDS. <%= link_to "Tell Amazon you want this.", "https://forums.aws.amazon.com/thread.jspa?messageID=548724", target: "_blank" %></p>
58
+ <p>Query stats are not available on Amazon RDS. <%= link_to "Tell Amazon you want this.", "https://forums.aws.amazon.com/thread.jspa?messageID=548724", target: "_blank" %></p>
59
59
  <% else %>
60
60
  <p>Make them available by adding the following lines to <code>postgresql.conf</code>:</p>
61
61
  <pre>shared_preload_libraries = 'pg_stat_statements'
data/lib/pghero.rb CHANGED
@@ -236,7 +236,7 @@ module PgHero
236
236
  end
237
237
 
238
238
  def query_stats_available?
239
- select_all("SELECT COUNT(*) AS count FROM pg_available_extensions WHERE name = 'pg_stat_statements' AND installed_version IS NOT NULL").first["count"].to_i > 0
239
+ select_all("SELECT COUNT(*) AS count FROM pg_available_extensions WHERE name = 'pg_stat_statements'").first["count"].to_i > 0 && !rds?
240
240
  end
241
241
 
242
242
  def query_stats_enabled?
@@ -270,6 +270,7 @@ module PgHero
270
270
  end
271
271
  end
272
272
 
273
+ # TODO better RDS check
273
274
  def rds?
274
275
  !!(Connection.connection_config[:host].to_s =~ /rds\.amazonaws\.com\z/)
275
276
  end
@@ -1,3 +1,3 @@
1
1
  module PgHero
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pghero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane