gitlab-org--gitlab-foss/bin/rspec-stackprof
Rémy Coutable 0a3f4dfc82
Don't require stackprof in Gemfile
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-09 10:10:33 +02:00

17 lines
449 B
Ruby
Executable file

#!/usr/bin/env ruby
require 'bundler/setup'
require 'stackprof'
$:.unshift 'spec'
require 'rails_helper'
filename = ARGV[0].split('/').last
interval = ENV.fetch('INTERVAL', 1000).to_i
limit = ENV.fetch('LIMIT', 20)
output_file = "tmp/#{filename}.dump"
StackProf.run(mode: :wall, out: output_file, interval: interval) do
RSpec::Core::Runner.run(ARGV, $stderr, $stdout)
end
system("bundle exec stackprof #{output_file} --text --limit #{limit}")