All Projects → igorkasyanchuk → Execution_time

igorkasyanchuk / Execution_time

Licence: mit
How fast is your code? See it directly in Rails console.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Execution time

Rails performance
Monitor performance of you Rails applications
Stars: ✭ 345 (+414.93%)
Mutual labels:  rails, ruby-on-rails, performance
Rspec Rails Examples
RSpec cheatsheet & Rails app: Learn how to expertly test Rails apps from a model codebase
Stars: ✭ 2,089 (+3017.91%)
Mutual labels:  rails-application, rails, ruby-on-rails
Leaky Gems
A list of Ruby gems that have known memory leaks (and issues)
Stars: ✭ 895 (+1235.82%)
Mutual labels:  rails, ruby-on-rails
Activejob Scheduler
A background job scheduler for any queue backend
Stars: ✭ 24 (-64.18%)
Mutual labels:  rails, ruby-on-rails
Ifme
Free, open source mental health communication web app to share experiences with loved ones
Stars: ✭ 1,147 (+1611.94%)
Mutual labels:  rails, ruby-on-rails
Fae
CMS for Rails. For Reals.
Stars: ✭ 701 (+946.27%)
Mutual labels:  rails, ruby-on-rails
Railsgoat
A vulnerable version of Rails that follows the OWASP Top 10
Stars: ✭ 699 (+943.28%)
Mutual labels:  rails, ruby-on-rails
Activeadmin froala editor
Froala WYSIWYG editor for ActiveAdmin
Stars: ✭ 30 (-55.22%)
Mutual labels:  rails, ruby-on-rails
Prosopite
🔍 Rails N+1 queries auto-detection with zero false positives / false negatives
Stars: ✭ 555 (+728.36%)
Mutual labels:  rails, performance
Drag and drop active storage
A demo drag and drop image upldate Ruby on Rails app using Stimulus.js, DropZone.js, and ActiveStorage
Stars: ✭ 46 (-31.34%)
Mutual labels:  rails, ruby-on-rails
Niklick
Rails Versioned API solution template for hipsters! (Ruby, Ruby on Rails, REST API, GraphQL, Docker, RSpec, Devise, Postgress DB)
Stars: ✭ 39 (-41.79%)
Mutual labels:  rails, ruby-on-rails
Graphql Rails Generators
Graphql Rails Scaffold™. Automatically generate GraphQL types from your rails models.
Stars: ✭ 47 (-29.85%)
Mutual labels:  rails, ruby-on-rails
Good job
Multithreaded, Postgres-based, ActiveJob backend for Ruby on Rails.
Stars: ✭ 676 (+908.96%)
Mutual labels:  rails, ruby-on-rails
Osem
Open Source Event Manager. An event management tool tailored to Free and Open Source Software conferences.
Stars: ✭ 649 (+868.66%)
Mutual labels:  rails-application, rails
Graphiti
Stylish Graph APIs
Stars: ✭ 783 (+1068.66%)
Mutual labels:  rails, ruby-on-rails
Open Build Service
Build and distribute Linux packages from sources in an automatic, consistent and reproducible way #obs
Stars: ✭ 599 (+794.03%)
Mutual labels:  rails-application, ruby-on-rails
Active record doctor
Identify database issues before they hit production.
Stars: ✭ 865 (+1191.04%)
Mutual labels:  rails, performance
Goldiloader
Just the right amount of Rails eager loading
Stars: ✭ 1,074 (+1502.99%)
Mutual labels:  ruby-on-rails, performance
Motion
Reactive frontend UI components for Rails in pure Ruby
Stars: ✭ 498 (+643.28%)
Mutual labels:  rails, ruby-on-rails
Annict
The platform for anime addicts built with Rails and Stimulus.js.
Stars: ✭ 542 (+708.96%)
Mutual labels:  rails-application, rails

ExecutionTime

Monitor execution time and other metrics directly in rails console, similar to what you see after each request.

[METRICS] Completed in 908.3ms | Allocations: 2894 | ActiveRecord: 0.9ms (queries: 13)

Usage

Just add this gem to the Gemfile and start rails c. After this try to do something like User.first.

If you want to measure few lines of code just wrap it with begin/end:

[4] pry(main)> begin
[4] pry(main)*   User.first.first_name.size
[4] pry(main)*   a = User.count + 1
[4] pry(main)*   b = User.second.last_name.size
[4] pry(main)* end  
  User Load (0.4ms)  SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT $1  [["LIMIT", 1]]
   (3.6ms)  SELECT COUNT(*) FROM "users"
  User Load (0.3ms)  SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT $1 OFFSET $2  [["LIMIT", 1], ["OFFSET", 1]]
[METRICS]  Completed in 6.8ms | Allocations: 839 | ActiveRecord: 4.3ms (queries: 3)
=> 5

Installation

Add this line to your application's Gemfile:

gem 'execution_time'

First run

Sometime you can see that there are more SQL queries or allocated objects because Ruby is just loading objects in memory or verifying connection to the DB.

How to disable/enable metrics output in the console

If you need to disable gem in the console you can do it by ExecutionTime.disable!. And later enable with ExecutionTime.enable!.

By default gem is enabled.

Contributing

You are welcome to contribute.

Contributos

License

The gem is available as open source under the terms of the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].