Sha256: b5c353d94c3aaa6b83e192c9c478a72a95b1d8689578ab8b6f23f3ba4f1f01fe
Contents?: true
Size: 873 Bytes
Versions: 1
Compression:
Stored size: 873 Bytes
Contents
require 'optparse' require 'tempfile' require 'tmpdir' require 'json' require 'etc' module PerfMonger module Command class RecordCommand < BaseCommand register_command 'record', 'Record system performance information' def initialize super end def run(argv) @argv, @option = PerfMonger::Command::RecordOption.parse(argv) if @option.kill session_file = File.expand_path(sprintf("perfmonger-%s-session.pid", Etc.getlogin), Dir.tmpdir) Process.kill(:INT, File.read(session_file).to_i) else exec_record_cmd() end end private def exec_record_cmd() cmd = @option.make_command if @option.background Process.daemon(true) else $stdout.puts("[recording to #{@option.logfile}]") end Process.exec(*cmd) end end end # module Command end # module PerfMonger
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
perfmonger-0.8.0 | lib/perfmonger/command/record.rb |