Class: PerfMonger::Command::RecordOption
- Inherits:
-
Object
- Object
- PerfMonger::Command::RecordOption
- Defined in:
- lib/perfmonger/command/record_option.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#devices ⇒ Object
readonly
Returns the value of attribute devices.
-
#interval ⇒ Object
readonly
Returns the value of attribute interval.
-
#logfile ⇒ Object
readonly
Returns the value of attribute logfile.
-
#no_disk ⇒ Object
readonly
Returns the value of attribute no_disk.
-
#parser ⇒ Object
readonly
Returns the value of attribute parser.
-
#record_bin ⇒ Object
Returns the value of attribute record_bin.
-
#report_cpu ⇒ Object
readonly
Returns the value of attribute report_cpu.
-
#verbose ⇒ Object
readonly
Returns the value of attribute verbose.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#devices ⇒ Object (readonly)
Returns the value of attribute devices.
6 7 8 |
# File 'lib/perfmonger/command/record_option.rb', line 6 def devices @devices end |
#interval ⇒ Object (readonly)
Returns the value of attribute interval.
7 8 9 |
# File 'lib/perfmonger/command/record_option.rb', line 7 def interval @interval end |
#logfile ⇒ Object (readonly)
Returns the value of attribute logfile.
11 12 13 |
# File 'lib/perfmonger/command/record_option.rb', line 11 def logfile @logfile end |
#no_disk ⇒ Object (readonly)
Returns the value of attribute no_disk.
10 11 12 |
# File 'lib/perfmonger/command/record_option.rb', line 10 def no_disk @no_disk end |
#parser ⇒ Object (readonly)
Returns the value of attribute parser.
13 14 15 |
# File 'lib/perfmonger/command/record_option.rb', line 13 def parser @parser end |
#record_bin ⇒ Object
Returns the value of attribute record_bin.
14 15 16 |
# File 'lib/perfmonger/command/record_option.rb', line 14 def record_bin @record_bin end |
#report_cpu ⇒ Object (readonly)
Returns the value of attribute report_cpu.
9 10 11 |
# File 'lib/perfmonger/command/record_option.rb', line 9 def report_cpu @report_cpu end |
#verbose ⇒ Object (readonly)
Returns the value of attribute verbose.
8 9 10 |
# File 'lib/perfmonger/command/record_option.rb', line 8 def verbose @verbose end |
Class Method Details
.parse(argv) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/perfmonger/command/record_option.rb', line 16 def self.parse(argv) option = self.new argv = option.parse(argv) return argv, option end |
Instance Method Details
#make_command ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/perfmonger/command/record_option.rb', line 33 def make_command @recorder_bin = ::PerfMonger::Command::CoreFinder.recorder() if ! @recorder_bin puts("ERROR: no executable binaries") exit(false) end cmd = [@recorder_bin] cmd << sprintf("-interval=%.1fms", @interval * 1000) if ! @interval_backoff cmd << "-no-interval-backoff" end if @start_delay > 0 cmd << "-start-delay" cmd << "#{@start_delay*1000}ms" end if @timeout cmd << "-timeout" cmd << "#{@timeout*1000}ms" end if @no_cpu cmd << "-no-cpu" end if @no_disk cmd << "-no-disk" end if @devices.size > 0 cmd << "-disks" cmd << @devices.join(",") end # TODO: implement device filter cmd << "-output" cmd << @logfile raise NotImplementedError if @verbose cmd end |
#parse(argv) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/perfmonger/command/record_option.rb', line 23 def parse(argv) argv = @parser.parse(argv) @no_cpu = false @no_disk = false @all_devices = true argv end |