No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
A panel that appears in the browser to provide stats on page load times and other debugging information for Rails 3 & 4
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
 Project Readme

Dev Panel

dev_panel is time saving tool for Rails Development that displays itself in the browser as a panel to provide useful information about the page load times and other debugging info. It allows you to quickly pin point slow pages or inefficencies within your web app without ever having to scroll through logs.

Features

  • Shows render times for the Controller, View and Model (Model is coming soon) as well as the overall time spent on the current page load.
  • Shows which controller was called and which controller action so you can easily find out where the code for the current page is.
  • Shows how many views were rendered to help identify inefficiencies.
  • Shows the response code returned as well as the HTTP request method.
  • Shows params so you can see what was passed to your controller.
  • Provides a logging facilty so you don't have to search your log files. Just say DevPanel::Stats.log("some val") and it will display in the panel. No need to raise an exception anymore.
  • Allows you to drag and drop the panel anywhere on the page and it will save that location between requests. It resets to the top left on server restart

Alt text

Installation

Just add the following to your Gemfile and restart your app server. DevPanel will display in the upper left and corner. If you wish to move it's location just drag it anywhere you'd like, it will keep that locations between requests.

group :development do
  gem "dev_panel"
end

Logging

One of dev_panel's most powerful features is to provide easy logging facilities that don't require using the Rails console, just edit your code and have debug info appear in the browser. There are two primary features when it comes to logging with dev_panel.

Time Based Logging

Want to profile some code and see how long it takes to execute? Just wrap it in a DevPanel::Stats.time block and you'll see the results in the log portion of the panel.

DevPanel::Stats.time do
  sleep(1)
end

Now if you look in the dev_panel you'll see something like 1002.34 in the log section. easy code profiling, yay!

Log Anything

Want to output some object you are working with to the screen for a quick inspection? Use this so you don't have to put raise's in your code.

DevPanel::Stats.log(33.class)

Now if you look in the dev_panel you'll see Fixnum. Way easier logging, and you can add as many log statements as you want!

Configuration

Be aware that DevPanel loads JQuery and JQuery UI at the bottom of your page via a CDN. Most people will have JQuery already and some will have JQuery UI as well, this should not be an issue because I have taken certain steps to avoid this being an issue but if you notice a conflict of some sort let me know.

You may also want to set the top and left position of the panel in case your app has some UI element that interferes with it. To change that just add this to your development.rb:

config.dev_panel_initial_top = 200
config.dev_panel_initial_left = 50