GithubHelp home page GithubHelp logo

hyperloop-rails / powerstation Goto Github PK

View Code? Open in Web Editor NEW
57.0 6.0 5.0 42.14 MB

A Tool for Detecting Performance Bugs in Rails Applications

Home Page: https://hyperloop-rails.github.io/

License: BSD 2-Clause "Simplified" License

Shell 0.47% JavaScript 0.52% CoffeeScript 0.01% CSS 1.03% Ruby 91.51% HTML 0.54% Python 3.40% C++ 0.23% Java 2.30%
rails rails-application webapp performance-analysis performance-tuning

powerstation's Introduction

PowerStation

Powerstation is a tool that finds performance bugs in Rails applications, for example, API misuse, repeated query, etc.

Using the tool

There are two ways to use Powerstation:

  • As a RubyMine plugin that you can download from the jetbrains website. The source code is included in this repo under powerstation/IDE_plugin.

  • As command line tool. The instructions and source code are included in this repo under powerstation/command_line_tool.

Both of these uses a static code checker that we have built to detect performance issues. The source code of the checker is in static-checker.

These are packaged in two separate branches (IDE_plugin, static-checker) in case you prefer checkout each part individually, for example:

$ git clone -b static-checker --single-branch https://github.com/hyperloop-rails/static-checker.git

Currently detected bugs

  1. Loop invariant queries

  2. Dead store queries

  3. Unused data-retrieval queries

  4. Common sub-expression queries

  5. API misuses

  6. Inefficient data rendering

Details of these are explained in our documentation.

See our main website for more details. Feel free to submit issues and pull requests!

powerstation's People

Contributors

akcheung avatar congy avatar hyperloop-rails avatar jwyoung1818 avatar ya8282 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

powerstation's Issues

Exclude `log` directory from analysis

It looks like the script greps everything inside the current directory.

Some directories should likely be excluded by default, like the /log directory, which frequently contains large files that don't have application code.

Still relevant to check `any?` & `where.first` ?

I believe more current versions of ActiveRecord address this. Notice that AR is using LIMIT 1 and isn't loading the result set into memory.

irb(main):007:0> User.where(email: 'email').exists?
  User Exists (1.0ms)  SELECT  1 AS one FROM `users` WHERE `users`.`email` = 'email' LIMIT 1
=> false
irb(main):008:0> User.where(email: 'email').any?
  User Exists (0.4ms)  SELECT  1 AS one FROM `users` WHERE `users`.`email` = 'email' LIMIT 1
=> false
irb(main):009:0> User.find_by(email: 'email')
  User Load (0.4ms)  SELECT  `users`.* FROM `users` WHERE `users`.`email` = 'email' LIMIT 1
=> nil
irb(main):010:0> User.where(email: 'email').first
  User Load (0.5ms)  SELECT  `users`.* FROM `users` WHERE `users`.`email` = 'email' ORDER BY `users`.`id` ASC LIMIT 1
=> nil

Credit to @mccallumjack.

No results directory created

No errors reported by Analyze, but when calling Show, exception occurs :

When I check in the PW-src directory, there is No results directory created.

However something ran as the code from the project has been copied to PW-src

Error on show :
image

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.