GithubHelp home page GithubHelp logo

tsukasaoishi / cat_tree Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 36 KB

CatTree monitors ActiveRecord objects in development environment the number of objects, the number of same objects, un-used objects etc.

License: MIT License

Ruby 97.34% Shell 2.66%

cat_tree's Introduction

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

cat_tree's People

Contributors

tsukasaoishi avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.