Top Level Namespace

Defined Under Namespace

Modules: CMSScanner, PublicSuffix, Typhoeus Classes: Numeric

Instance Method Summary collapse

Instance Method Details

#memory_usageInteger

Returns The memory of the current process in Bytes.

Returns:

  • (Integer)

    The memory of the current process in Bytes



9
10
11
# File 'lib/cms_scanner/helper.rb', line 9

def memory_usage
  `ps -o rss= -p #{Process.pid}`.to_i * 1024 # ps returns the value in KB
end

#redirect_output_to_file(file) ⇒ Object

Parameters:

  • file (String)

    The file path



2
3
4
5
6
# File 'lib/cms_scanner/helper.rb', line 2

def redirect_output_to_file(file)
  $stdout.reopen(file, 'w')
  $stdout.sync = true
  $stderr.reopen($stdout) # Not sure if this is needed
end