Module: Leaks::Printer

Defined in:
lib/leaks/printer.rb

Class Method Summary collapse

Class Method Details



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/leaks/printer.rb', line 11

def self.print_status
  print "#{13.chr}#{Spinner} "

  status = "Runs: #{Runner.runs} #{Runner.ram_usage} Stable: #{Runner.ram_usage.stable_for} sec    "

  if Runner.ram_usage.increased?
    print "\033[31m#{status}\033[0m"
  else
    print "\033[32m#{status}\033[0m"
  end
end

.runObject



3
4
5
6
7
8
9
# File 'lib/leaks/printer.rb', line 3

def self.run
  loop do
    Runner.ram_usage.update
    print_status
    sleep 0.1
  end
end