Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Lightweight monitor for performance regressions in Development

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 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.