https://github.com/am-kantox/rspec-benchmarks
Handy measures for rspec tests. SQL/View/Controller separated reports. Sophisticated SQL analysis.
https://github.com/am-kantox/rspec-benchmarks
Last synced: 23 days ago
JSON representation
Handy measures for rspec tests. SQL/View/Controller separated reports. Sophisticated SQL analysis.
- Host: GitHub
- URL: https://github.com/am-kantox/rspec-benchmarks
- Owner: am-kantox
- Created: 2015-05-06T15:15:33.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-05-08T15:31:28.000Z (almost 10 years ago)
- Last Synced: 2025-02-09T19:53:14.534Z (3 months ago)
- Language: Ruby
- Size: 156 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rspec::Benchmarks
This gem provides benchmarks-on-steroids functionality to rspec. Currently it allows:
* print out summaries on [view, controller, db] access for each rspec example; pitfalls: different rails events show ...hummm... very different times, still trying to configure out wtf (rails developers are definitely anarchists, please refer to _“Anthropology from a Pragmatic Point of View”_ by Immanuel Kant;)
* adopted SQL lexer to build AST based on db queries; it was sexy but I still can’t understand what I have this implemented for (possible application: analysis of heavy queries by their structure)
* ability to make examples _fail_ unless they are passed in specified timeslice (relative times are used, no dependence on target machine equipment, times are normalized by precalculated value)
* ability to turn on the full benchmark logging (holy load of statistics.)
* pickup tests to run from git commit;
* highly tunable running config.## Impression

## Installation
Add this line to your application's Gemfile:
```ruby
gem 'rspec-benchmarks'
```## Usage
$ BENCHMARK=true bundle exec rspec `bspec last:5`
I know it’s ugly syntax, but it will execute five last specs added (basing on git history.)
Or, more usable:
$ BENCHMARK=true bundle exec rspec spec/controllers/my_controller.rb
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Contributing
1. Fork it ( https://github.com/[my-github-username]/rspec-benchmarks/fork )
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 a new Pull Request