Class: Zold::Routines::Audit

Inherits:
Object
  • Object
show all
Defined in:
lib/zold/commands/routines/audit.rb

Overview

Audit the system

Instance Method Summary collapse

Constructor Details

#initialize(opts, wallets, log: Log::NULL) ⇒ Audit

Returns a new instance of Audit.



35
36
37
38
39
# File 'lib/zold/commands/routines/audit.rb', line 35

def initialize(opts, wallets, log: Log::NULL)
  @opts = opts
  @wallets = wallets
  @log = log
end

Instance Method Details

#exec(_ = 0) ⇒ Object



41
42
43
44
45
46
47
48
49
50
# File 'lib/zold/commands/routines/audit.rb', line 41

def exec(_ = 0)
  sleep(60) unless @opts['routine-immediately']
  @log.info(
    'Audit: ' + [
      "memory used: #{Size.new(GetProcessMem.new.bytes.to_i)}",
      "threads total: #{Thread.list.count}",
      "wallets: #{@wallets.count}"
    ].join('; ')
  )
end