How it works
Install the Gem
Add our gem to your test suite, every time you run your test suite the gem will monitor your app & log metrics such as database requests and memory usage.
Commits that exceed a normal threshold will cause the test suite to fail, you can then investigate by reviewing the output.
Adding the Gem
Add the gem to your Gemfile within a test group, so it'll only run when you run the test suite:
# Gemfile group :test do gem 'pig-ci-rails' end
You can change the thresholds, when your test suite exceeds these it will fail.
# spec/rails_helper.rb require 'pig_ci' PigCI.start do |config| # Maximum memory in megabytes config.thresholds.memory = 350 # Maximum time per a HTTP request config.thresholds.request_time = 250 # Maximum database calls per a request config.thresholds.database_request = 35 end if RSpec.configuration.files_to_run.count > 1
Ruby on Rails
PigCI currently supports Ruby on Rails, tested via Rspec.