Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save prathmeshranaut/565f78ceacaab9644c738900c3a5a9e0 to your computer and use it in GitHub Desktop.
Save prathmeshranaut/565f78ceacaab9644c738900c3a5a9e0 to your computer and use it in GitHub Desktop.
Added Line 7-11 to allow benchmark a specific file only
require "timeout"
desc "Run Celluloid benchmarks"
task :benchmark do
begin
Timeout.timeout(120) do
if ENV['FILE']
glob = File.expand_path("../../benchmarks/#{ENV['FILE']}.rb", __FILE__)
else
glob = File.expand_path("../../benchmarks/*.rb", __FILE__)
end
Dir[glob].each { |benchmark| load benchmark }
end
rescue ::Exception, Timeout::Error => ex
puts "ERROR: Couldn't complete benchmark: #{ex.class}: #{ex}"
puts " #{ex.backtrace.join("\n ")}"
exit 1 unless ENV["CI"] # Hax for running benchmarks on Travis
end
end
@prathmeshranaut
Copy link
Author

Added Line 7-11 to allow benchmark a specific file only.
if ENV['FILE'] glob = File.expand_path("../../benchmarks/#{ENV['FILE']}.rb", __FILE__) else glob = File.expand_path("../../benchmarks/*.rb", __FILE__) end

Should I create a pull request for this?

@chuckremes
Copy link

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment