Method: Beaker::Perf#get_perf_data

Defined in:
lib/beaker/perf.rb

#get_perf_data(host, perf_start, perf_end) ⇒ void

This method returns an undefined value.

If host is a supported (ie linux) platform, generate a performance report

Parameters:

  • host (Host)

    The host we are working with

  • perf_start (Time)

    The beginning time for the SAR report

  • perf_end (Time)

    The ending time for the SAR report



74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/beaker/perf.rb', line 74

def get_perf_data(host, perf_start, perf_end)
  @logger.perf_output("Getting perf data for host: " + host)
  if host['platform'] =~ PERF_SUPPORTED_PLATFORMS # All flavours of Linux
    if not @options[:collect_perf_data] =~ /aggressive/
      host.exec(Command.new("sar -A -s #{perf_start.strftime("%H:%M:%S")} -e #{perf_end.strftime("%H:%M:%S")}"),:acceptable_exit_codes => [0,1,2])
    end
    if (defined? @options[:graphite_server] and not @options[:graphite_server].nil?) and
       (defined? @options[:graphite_perf_data] and not @options[:graphite_perf_data].nil?)
      export_perf_data_to_graphite(host)
    end
  else
    @logger.perf_output("Perf (sysstat) not supported on host: " + host)
  end
end