module Process::Metrics

Constants

FIELDS

pid: Process Identifier pmem: Percentage Memory used. pcpu: Percentage Processor used. time: The process time used (executing on CPU). vsz: Virtual Size in kilobytes rss: Resident Set Size in kilobytes etime: The process elapsed time. command: The name of the process.

PS
VERSION

Public Class Methods

duration(value) click to toggle source

According to the linux manual page specifications.

# File lib/process/metrics/general.rb, line 31
def self.duration(value)
        if /((?<days>\d\d)\-)?((?<hours>\d\d):)?(?<minutes>\d\d):(?<seconds>\d\d)?/ =~ value
                (((days&.to_i || 0) * 24 + (hours&.to_i || 0)) * 60 + (minutes&.to_i || 0)) * 60 + seconds&.to_i
        end
end