20 lines
661 B
Ruby
20 lines
661 B
Ruby
namespace :trading_fee_test do
|
|
|
|
task :amqp, [:config_load_path] => [:environment] do |_t, args|
|
|
args.with_defaults(:config_load_path => 'config/bench/trade_execution.yml')
|
|
benches =
|
|
YAML.load_file(Rails.root.join(args[:config_load_path]))
|
|
.map(&:deep_symbolize_keys)
|
|
.each_with_object([]) do |config, memo|
|
|
Kernel.pp config
|
|
trade_execution = ::Bench::TradeExecution::AMQP.new(config)
|
|
trade_execution.run_fee!
|
|
memo << trade_execution
|
|
trade_execution.save_report
|
|
Kernel.puts "Sleep before next bench"
|
|
sleep 5
|
|
end
|
|
|
|
benches.each {|b| Kernel.pp b.result}
|
|
end
|
|
end |