Sha256: 35f48e4ec73a8f63f13c0dec90bc8c3c33a149329713fe68ecb0e4983a727689

Contents?: true

Size: 399 Bytes

Versions: 1

Compression:

Stored size: 399 Bytes

Contents

require 'socket'
require 'get_process_mem'

module Rails
  module Internals
    class ProcessInfo
      def initialize(memory_usage: GetProcessMem.new.bytes)
        @memory_usage = memory_usage
      end

      def hostname
        Socket.gethostname
      end

      def pid
        Process.pid
      end

      def memory_usage
        @memory_usage.to_s(:human_size)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails-internals-0.1.0 app/models/rails/internals/process_info.rb