pghero 1.6.4 → 1.6.5
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.
Potentially problematic release.
This version of pghero might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/pghero/engine.rb +10 -7
- data/lib/pghero/methods/replica.rb +1 -1
- data/lib/pghero/methods/system.rb +9 -3
- data/lib/pghero/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9c35316e3a2a8e668c93e3f6464359dddcc914e
|
4
|
+
data.tar.gz: 4712b121ee072c668be2083bb9b26b356446b2a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15d0d1f9f455bd731564dea8d34556730cd0bb4bc140eead1c38b62a3453a7cb7d076148a56cb96b493beccf2a00377603f4385ed360d78b8df60157fb948a4b
|
7
|
+
data.tar.gz: f0e884fd5c1c9d028ec7dca77607b37c3533aab9944397f00859f884c87bd36ddbe2f2f50a6abd3e9c72aed906a4c94e8fa2de78b11d271db0b7a0773f40fcaa
|
data/CHANGELOG.md
CHANGED
data/lib/pghero/engine.rb
CHANGED
@@ -3,13 +3,16 @@ module PgHero
|
|
3
3
|
isolate_namespace PgHero
|
4
4
|
|
5
5
|
initializer "pghero", group: :all do |app|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
# check if Rails api mode
|
7
|
+
if app.config.respond_to?(:assets)
|
8
|
+
if defined?(Sprockets) && Sprockets::VERSION >= "4"
|
9
|
+
app.config.assets.precompile << "pghero/application.js"
|
10
|
+
app.config.assets.precompile << "pghero/application.css"
|
11
|
+
else
|
12
|
+
# use a proc instead of a string
|
13
|
+
app.config.assets.precompile << proc { |path| path == "pghero/application.js" }
|
14
|
+
app.config.assets.precompile << proc { |path| path == "pghero/application.css" }
|
15
|
+
end
|
13
16
|
end
|
14
17
|
|
15
18
|
PgHero.time_zone = PgHero.config["time_zone"] if PgHero.config["time_zone"]
|
@@ -3,7 +3,7 @@ module PgHero
|
|
3
3
|
module Replica
|
4
4
|
def replica?
|
5
5
|
unless defined?(@replica)
|
6
|
-
@replica = select_all("SELECT
|
6
|
+
@replica = PgHero.truthy?(select_all("SELECT pg_is_in_recovery()").first["pg_is_in_recovery"])
|
7
7
|
end
|
8
8
|
@replica
|
9
9
|
end
|
@@ -23,11 +23,17 @@ module PgHero
|
|
23
23
|
|
24
24
|
def rds_stats(metric_name, options = {})
|
25
25
|
if system_stats_enabled?
|
26
|
+
options = {region: region}
|
27
|
+
if access_key_id
|
28
|
+
options[:access_key_id] = access_key_id
|
29
|
+
options[:secret_access_key] = secret_access_key
|
30
|
+
end
|
31
|
+
|
26
32
|
client =
|
27
33
|
if defined?(Aws)
|
28
|
-
Aws::CloudWatch::Client.new(
|
34
|
+
Aws::CloudWatch::Client.new(options)
|
29
35
|
else
|
30
|
-
AWS::CloudWatch.new(
|
36
|
+
AWS::CloudWatch.new(options).client
|
31
37
|
end
|
32
38
|
|
33
39
|
duration = (options[:duration] || 1.hour).to_i
|
@@ -58,7 +64,7 @@ module PgHero
|
|
58
64
|
end
|
59
65
|
|
60
66
|
def system_stats_enabled?
|
61
|
-
!!((defined?(Aws) || defined?(AWS)) &&
|
67
|
+
!!((defined?(Aws) || defined?(AWS)) && db_instance_identifier)
|
62
68
|
end
|
63
69
|
|
64
70
|
def access_key_id
|
data/lib/pghero/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pghero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|