Class: Maatkit::ProfileCompact

Inherits:
Object
  • Object
show all
Defined in:
lib/maatkit-ruby/mk-profile-compact.rb

Overview

Compact the output from mk-query-profiler.

Maatkit::ProfileCompact.new( array, str, array)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeProfileCompact

Returns a new ProfileCompact Object



30
31
# File 'lib/maatkit-ruby/mk-profile-compact.rb', line 30

def initialize()
end

Instance Attribute Details

#configObject

/etc/maatkit/maatkit.conf,/etc/maatkit/mk-profile-compact.conf,/home/joel/.maatkit.conf,/home/joel/.mk-profile-compact.conf



15
16
17
# File 'lib/maatkit-ruby/mk-profile-compact.rb', line 15

def config
  @config
end

#headersObject

2000



16
17
18
# File 'lib/maatkit-ruby/mk-profile-compact.rb', line 16

def headers
  @headers
end

#helpObject

TRUE



17
18
19
# File 'lib/maatkit-ruby/mk-profile-compact.rb', line 17

def help
  @help
end

#modeObject

(No # value)



18
19
20
# File 'lib/maatkit-ruby/mk-profile-compact.rb', line 18

def mode
  @mode
end

#path_to_mk_profile_compactObject

Sets the executable path, otherwise the environment path will be used.



25
26
27
# File 'lib/maatkit-ruby/mk-profile-compact.rb', line 25

def path_to_mk_profile_compact
  @path_to_mk_profile_compact
end

#queriesObject

(No # value)



19
20
21
# File 'lib/maatkit-ruby/mk-profile-compact.rb', line 19

def queries
  @queries
end

#versionObject

FALSE



20
21
22
# File 'lib/maatkit-ruby/mk-profile-compact.rb', line 20

def version
  @version
end

Instance Method Details

#start(options = nil) ⇒ Object

Execute the command



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/maatkit-ruby/mk-profile-compact.rb', line 36

def start(options = nil)
  tmp = Tempfile.new('tmp')
  command = option_string() + options.to_s + " 2> " + tmp.path
  success = system(command)
  if success
    begin
      while (line = tmp.readline)
        line.chomp
        selected_string = line
      end
    rescue EOFError
      tmp.close
    end
    return selected_string
  else
    tmp.close!
    return success
  end
end