Class: ActivePostgres::Overview

Inherits:
Object
  • Object
show all
Defined in:
lib/active_postgres/overview.rb

Constant Summary collapse

DEFAULT_TIMEOUT =
10

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Overview

Returns a new instance of Overview.



8
9
10
11
12
# File 'lib/active_postgres/overview.rb', line 8

def initialize(config)
  @config = config
  @executor = SSHExecutor.new(config, quiet: true)
  @health_checker = HealthChecker.new(config)
end

Instance Method Details

#showObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/active_postgres/overview.rb', line 14

def show
  puts
  puts "ActivePostgres Control Tower (#{config.environment})"
  puts '=' * 70
  puts

  health_checker.show_status

  show_system_stats
  show_repmgr_cluster if config.component_enabled?(:repmgr)
  show_pgbouncer_targets if config.component_enabled?(:pgbouncer)
  show_dns_status if dns_failover_enabled?
  show_backups if config.component_enabled?(:pgbackrest)

  puts
end