Project

cat_tree

0.0
No commit activity in last 3 years
No release in over 3 years
CatTree monitors ActiveRecord objects in development environment
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

< 2.0, >= 1.3.0
< 0.5, >= 0.3.18
>= 0.8.7
>= 0

Runtime

< 5.2, >= 4.2.0
 Project Readme

CatTree

Gem Version Build Status Code Climate

CatTree monitors ActiveRecord objects in development environment the number of objects and the number of same objects. It helps you decrease waste of memory and increase application performance.

CatTree

Usage

You can be used by simply installing. CatTree notifies the result analyzing ActiveRecord objects. Look at the Rails log when Rails action finished.

Started GET "/top" for xxx.xxx.xxx.xxx at yyyy
Processing by TopController#index as HTML
  Parameters: {}
  ....

[CatTree]
  ActiveRecord::Base:     102
  Same objects:
    User(id:12):  2

Completed 200 OK in 1121.8ms (Views: 899.0ms | ActiveRecord: 222.8ms)

If you need backtrace of same objects,

CatTree::Config.backtrace = true

then

Started GET "/top" for xxx.xxx.xxx.xxx at yyyy
Processing by TopController#index as HTML
  Parameters: {}
  ....

[CatTree]
  ActiveRecord::Base:     102
  Same objects:
    User(id:12):  2
      /Users/tsukasa/dev/kaeruspoon/app/controllers/top_controller.rb:5:in `index'

      /Users/tsukasa/dev/kaeruspoon/app/controllers/top_controller.rb:6:in `index'

Completed 200 OK in 1121.8ms (Views: 899.0ms | ActiveRecord: 222.8ms)

Installation

Add this line to your application's Gemfile:

gem 'cat_tree'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cat_tree

Contributing

  1. Fork it ( https://github.com/[my-github-username]/cat_tree/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

Test

I'm glad that you would do test! To run the test suite, you need mysql installed. How to setup your test environment.

bundle install --path bundle
GEM_HOME=bundle/ruby/(your ruby version) gem install bundler --pre
bundle exec appraisal install

This command run the spec suite for all rails versions supported.

bundle exec appraisal rake spec