1
0

Add performance benchmarking scripts

Add scripts that were used to generate a halfway realistic
set of inputs
This commit is contained in:
Tim Kächele 2021-11-22 18:40:12 +01:00
parent fbebe75e2d
commit 87d4205f40
3 changed files with 33 additions and 0 deletions

13
scripts/generate_input.rb Normal file
View File

@ -0,0 +1,13 @@
require 'date'
def build(n)
shipping_options = ['S', 'M', 'L']
provider = ['MR', 'LP']
today = Date.today
n.times do |n|
today + (n / 100.to_f)
puts "#{(today + n).iso8601} #{shipping_options.sample} #{provider.sample}"
end
end
build(ARGV[0].to_i)

View File

@ -0,0 +1,13 @@
require 'date'
def build(n)
shipping_options = ['S', 'M', 'L']
provider = ['MR', 'LP']
today = Date.today
n.times do |i|
date = today + (i / 10000.to_f)
puts "#{date.iso8601} #{shipping_options.sample} #{provider.sample}"
end
end
build(ARGV[0].to_i)

View File

@ -0,0 +1,7 @@
File.open('./output.txt', 'w') do |f|
File.foreach(ARGV[0]) do |line|
f.write(line)
end
end