Sha256: 949f926955397a55c6f400dce329653ac26d62fb56014513c8866ba1fad11423

Contents?: true

Size: 461 Bytes

Versions: 9

Compression:

Stored size: 461 Bytes

Contents

require 'fastercsv'

module OutputToCSV
  def self.output_results( filename, results )
    FasterCSV.open( filename, 'w' ) do |csv|
      # Iterate over each result set, which contains many results
      results.each do |result_set|
        columns, times = [], []
        result_set.each do |result| 
          columns << result.description
          times << result.tms.real
        end
        csv << columns
        csv << times
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
activerecord-import-0.10.0 benchmarks/lib/output_to_csv.rb
activerecord-import-0.9.0 benchmarks/lib/output_to_csv.rb
activerecord-import-0.8.0 benchmarks/lib/output_to_csv.rb
activerecord-import-0.7.0 benchmarks/lib/output_to_csv.rb
activerecord-import-0.6.0 benchmarks/lib/output_to_csv.rb
activerecord-import-0.5.0 benchmarks/lib/output_to_csv.rb
activerecord-import-0.4.1 benchmarks/lib/output_to_csv.rb
activerecord-import-0.4.0 benchmarks/lib/output_to_csv.rb
activerecord-import-rails4-0.5.0 benchmarks/lib/output_to_csv.rb