Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Lightweight monitor for performance regressions in Development
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
.gitignore
Gemfile
LICENSE.txt
README.md
Rakefile
watches_benchmark.gemspec

README.md

WatchesBenchmark

Lightweight monitor for performance regressions in Development. Setup thresholds for methods in milliseconds and be alerted when they run over. Basically, try to catch performance mistakes as close as possible to when they are made.

Uses notifier to interact with Growl or whatnot.

Pre-Alpha quality (no tests, experimenting, etc.)

Installation

Add this line to your application's Gemfile:

gem 'watches_benchmark', github: 'zhubert/watches_benchmark'

And then execute:

$ bundle

Usage

Enable it in whatever environments you would like:

WatchesBenchmark.enable

Include it in whichever classes you want to watch and specify a hash of method_name to millisecond mappings:

include WatchesBenchmark
watches_benchmark method_a: 15, method_b: 20

Whenever that method takes longer than your threshold, the log will show (in red):

Performance Regression: method_a took 16.85ms, threshold is 15ms

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Something went wrong with that request. Please try again.