Skip to content

Commit

Permalink
Merge pull request #281 from danmayer/benchmark_report_coverage_memory
Browse files Browse the repository at this point in the history
Add ability to benchmark ton of files
  • Loading branch information
danmayer committed Jun 11, 2019
2 parents ea97e5d + 178d019 commit 2166166
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
11 changes: 11 additions & 0 deletions test/benchmarks/benchmark.rake
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,17 @@ namespace :benchmarks do
run_work(true)
end

task run_big: %i[setup setup_redis] do
require 'memory_profiler'
require './test/unique_files'
1000.times { require_unique_file }
# warmup
3.times { Coverband.report_coverage }
MemoryProfiler.report do
10.times { Coverband.report_coverage }
end.pretty_print
end

# desc 'runs benchmarks file store'
task run_file: %i[setup setup_file] do
puts 'Coverband configured with file store'
Expand Down
6 changes: 4 additions & 2 deletions test/unique_files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def remove_unique_files
FileUtils.rm_r(UNIQUE_FILES_DIR) if File.exist?(UNIQUE_FILES_DIR)
end

Minitest.after_run do
remove_unique_files
if defined?(Minitest)
Minitest.after_run do
remove_unique_files
end
end

0 comments on commit 2166166

Please sign in to comment.