1- Insight
1+ Rack:: Insight
22=========
33
4- Insight began life as an LRDesign fork of Rack::Bug by brynary. We started a
5- fork because, at the time, the main project wasn't making progress on Rails 3
6- support. Since then we've rewritten a lot of the code to make it more modular,
7- easier to extend, and to store information about multiple requests so you can
8- use it to inspect your AJAX requests (or any past request), not just previous
9- page loads.
4+ Rack::Insight began life as an fork of Logical::Insight by LRDesign. I started a
5+ fork because LogicalInsight was namespaced as "Insight", which is causing namespace
6+ collisions everywhere I have an Insight model. I had to re-namespace all the code.
7+ I also needed to build a few extension gems with additional panels, and added the
8+ Config class to allow for custom panel load paths, and other future extensions
9+ that don't work in the * use Middleware* declaration. It should be * even* easier
10+ to extend than LogicalInsight was, because extension gems can access the Config class
11+ and truly bolt-on cleanly.
1012
11- Having made really significant architectural changes, we 'll be keeping Insight
13+ Having made really significant architectural changes, I 'll be keeping Rack:: Insight
1214a separate project for the forseeable future.
1315
14- * Forked From: [ rack-bug] ( http://github.com/brynary/rack-bug )
15-
16- * [ Full documentation] ( http://lrdesign.github.com/logical-insight/ )
16+ * Forked From: [ logical-insight] ( http://github.com/LRDesign/logical-insight ) , [ documentation] ( http://lrdesign.github.com/rack-insight/ )
17+ * Which Was Forked From: [ rack-bug] ( http://github.com/brynary/rack-bug )
1718
1819Description
1920-----------
2021
21- Insight adds a diagnostics toolbar to Rack apps. When enabled, it injects a floating div
22- allowing exploration of logging, database queries, template rendering times, etc. Insight
22+ Rack:: Insight adds a diagnostics toolbar to Rack apps. When enabled, it injects a floating div
23+ allowing exploration of logging, database queries, template rendering times, etc. Rack:: Insight
2324stores debugging info over many requests, incuding AJAX requests.
2425
2526Features
2627--------
2728
2829* Password-based security
2930* IP-based security
30- * Insight instrumentation/reporting is broken up into panels.
31+ * Rack:: Insight instrumentation/reporting is broken up into panels.
3132 * Panels in default configuration:
3233 * Rails Info
3334 * Timer
@@ -54,22 +55,22 @@ Rails quick start
5455---------------------------
5556
5657Add this to your Gemfile
57- gem "logical -insight"
58+ gem "rack -insight"
5859
5960In config/environments/development.rb, add:
6061
61- config.middleware.use "Insight::App",
62+ config.middleware.use "Rack:: Insight::App",
6263 :secret_key => "someverylongandveryhardtoguesspreferablyrandomstring"
6364
64- Any environment with Insight loaded will have a link to "Insight" added to as
65+ Any environment with Rack:: Insight loaded will have a link to "Rack:: Insight" added to as
6566the last child of BODY to normal responses. Clicking that link will load the
66- toolbar. It's set with an id of "logical -insight-enabler", so it can be styled
67+ toolbar. It's set with an id of "rack -insight-enabler", so it can be styled
6768to go somewhere more noticeable. E.g. "position: absolute; top: 0; left: 0"
6869
6970Using with non-Rails Rack apps
7071------------------------------
7172
72- Just 'use Insight' as any other middleware. See the SampleApp in the
73+ Just 'use Rack:: Insight' as any other middleware. See the SampleApp in the
7374spec/fixtures folder for an example Sinatra app.
7475
7576If you wish to use the logger panel define the LOGGER constant that is a ruby
@@ -80,9 +81,9 @@ Configuring custom panels
8081
8182Specify the set of panels you want, in the order you want them to appear:
8283
83- require "logical -insight"
84+ require "rack -insight"
8485
85- ActionController::Dispatcher.middleware.use "Insight::App",
86+ ActionController::Dispatcher.middleware.use "Rack:: Insight::App",
8687 :secret_key => "someverylongandveryhardtoguesspreferablyrandomstring",
8788 :panel_files => %w[
8889 timer_panel
@@ -93,14 +94,30 @@ Specify the set of panels you want, in the order you want them to appear:
9394 memory_panel
9495 ]
9596
96- Files are looked up by prepending "insight/panels/" and requiring them.
97- Subclasses of Insight::Panel are loaded and added to the toolbar. This makes
98- it easier to work with the configuration and extend Insight with plugin gems.
97+ By default panel files are looked up by prepending "rack/insight/panels/" and requiring them.
98+ Subclasses of Rack::Insight::Panel are loaded and added to the toolbar. This makes
99+ it easier to work with the configuration and extend Rack::Insight with plugin gems.
100+
101+ If you need to customize the load paths where Rack::Insight will look for panels you can configure the load paths in an
102+ initializer. Example config/initializers/rack_insight.rb:
103+
104+ Rack::Insight::Config.configure do |config|
105+
106+ # Note: The parent directory of the 'special' directory must already be in Ruby's load path.
107+ config[:panel_load_paths] = File.join('special','path')
108+
109+ # Example 1: Do not load any of the regular Rack::Insight panels:
110+ config[:panel_load_paths] = File.join('my','custom','panel','directory')
111+
112+ # Example 2: Add your custom path to the existing load paths, to have your panels join the party!
113+ config[:panel_load_paths] << 'custom/panels'
114+
115+ end
99116
100- Running Insight in staging or production
117+ Running Rack:: Insight in staging or production
101118------------------------------------------
102119
103- We have have found that Insight is fast enough to run in production for specific troubleshooting efforts.
120+ We have have found that Rack:: Insight is fast enough to run in production for specific troubleshooting efforts.
104121
105122### Configuration ####
106123
@@ -113,23 +130,23 @@ Restrict access to particular IP addresses:
113130
114131 require "ipaddr"
115132
116- ActionController::Dispatcher.middleware.use "Insight::App"
133+ ActionController::Dispatcher.middleware.use "Rack:: Insight::App"
117134 :secret_key => "someverylongandveryhardtoguesspreferablyrandomstring",
118135 :ip_masks => [IPAddr.new("2.2.2.2/0")]
119136
120137Restrict access using a password:
121138
122- ActionController::Dispatcher.middleware.use "Insight::App",
139+ ActionController::Dispatcher.middleware.use "Rack:: Insight::App",
123140 :secret_key => "someverylongandveryhardtoguesspreferablyrandomstring",
124141 :password => "yourpassword"
125142
126143#### custom file path for the logging database ####
127144
128- Logical Insight uses SQLite to store data from requests, and outputs a database
145+ Logical Rack:: Insight uses SQLite to store data from requests, and outputs a database
129146file in the root directory. If you need the file to be created at another
130147location (i.e. Heroku), you can pass a custom file path.
131148
132- ActionController::Dispatcher.middleware.use "Insight::App"
149+ ActionController::Dispatcher.middleware.use "Rack:: Insight::App"
133150 :secret_key => "someverylongandveryhardtoguesspreferablyrandomstring",
134151 :database_path => "tmp/my_insight_db.sqlite"
135152
@@ -142,15 +159,31 @@ Authors
142159
143160Thanks
144161------
145- Insight owes a lot to Rack::Bug, as the basis project . There's a lot of smart
146- in there. Many thanks to Bryan for building it .
162+ Rack:: Insight owes a lot to both LogicalInsight and Rack::Bug, as the basis projects . There's a lot of smart
163+ in there. Many thanks to Evan, Judson, and Bryan for building them .
147164
148165Inspiration for Rack::Bug is primarily from the Django debug toolbar.
149166Additional ideas from Rails footnotes, Rack's ShowException middleware, Oink,
150167and Rack::Cache
151168
152-
153169License
154170-------
155171
156- See MIT-LICENSE.txt in this directory.
172+ See LICENSE.txt in this directory.
173+
174+ Notes
175+ -----
176+
177+ Legacy files: would like to re-include them, but they need work
178+
179+ lib/insight/views/panels/mongo.html.erb
180+ lib/insight/panels/mongo_panel/mongo_extension.rb
181+ lib/insight/panels/mongo_panel/stats.rb
182+ lib/insight/panels/mongo_panel.rb
183+
184+ lib/insight/views/panels/sphinx.html.erb
185+ lib/insight/panels/sphinx_panel/stats.rb
186+ lib/insight/panels/sphinx_panel.rb
187+
188+ This one is mostly just a curiosity
189+ lib/insight/panels/speedtracer_panel/profiling.rb
0 commit comments