gitlab-peek 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/.travis.yml +12 -0
- data/CHANGELOG.md +96 -0
- data/Gemfile +30 -0
- data/Gemfile-rails42 +27 -0
- data/LICENSE.txt +22 -0
- data/README.md +253 -0
- data/Rakefile +13 -0
- data/app/assets/javascripts/peek.js +86 -0
- data/app/assets/javascripts/peek/vendor/jquery.tipsy.js +258 -0
- data/app/assets/stylesheets/peek.scss +85 -0
- data/app/assets/stylesheets/peek/vendor/tipsy.scss +22 -0
- data/app/controllers/peek/results_controller.rb +25 -0
- data/app/views/peek/_bar.html.erb +11 -0
- data/config/routes.rb +3 -0
- data/gitlab-peek.gemspec +22 -0
- data/lib/peek.rb +93 -0
- data/lib/peek/adapters/base.rb +17 -0
- data/lib/peek/adapters/elasticsearch.rb +33 -0
- data/lib/peek/adapters/memcache.rb +25 -0
- data/lib/peek/adapters/memory.rb +25 -0
- data/lib/peek/adapters/redis.rb +21 -0
- data/lib/peek/controller_helpers.rb +22 -0
- data/lib/peek/railtie.rb +37 -0
- data/lib/peek/version.rb +3 -0
- data/lib/peek/views/view.rb +124 -0
- data/test/controllers/requests_test.rb +33 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +16 -0
- data/test/dummy/app/assets/stylesheets/application.css +14 -0
- data/test/dummy/app/controllers/application_controller.rb +13 -0
- data/test/dummy/app/controllers/home_controller.rb +11 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/home/show.html.erb +5 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/peek/_test_view.html.erb +1 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +25 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +23 -0
- data/test/dummy/config/environments/test.rb +36 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/peek.rb +3 -0
- data/test/dummy/config/initializers/secret_token.rb +12 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +8 -0
- data/test/dummy/lib/test_view.rb +18 -0
- data/test/dummy/public/404.html +58 -0
- data/test/dummy/public/422.html +58 -0
- data/test/dummy/public/500.html +57 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/peek/views/view_test.rb +37 -0
- data/test/peek_test.rb +69 -0
- data/test/test_helper.rb +22 -0
- metadata +161 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 35aa5dfb6cb3c23cb2baeecc67e0ca8322a4f04441716acff59622edba80a3ac
|
4
|
+
data.tar.gz: 380a9454d98a9119a76beb0ce3c7f7cfc2229fd4feb18571cc1273211903954b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b76348850a04c23876b7f43c47e9dded0077d42340dd51844256f07cbc4df398d113f89dbd93cbe77a7789e0a6cc66211c3f0511685395c95b6072c3bdeb99a6
|
7
|
+
data.tar.gz: 684ca844f3b3c6d0a6b37e43e0dca357d325eed79032136d313b4afc821db1ee7029a21f6c039295094d616252affbe99ccf56822b488acc42a241a1adb1964f
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
# 0.0.1
|
2
|
+
|
3
|
+
- Initial release.
|
4
|
+
|
5
|
+
# 0.0.2
|
6
|
+
|
7
|
+
- Add own tipsy plugin to allow for tooltips.
|
8
|
+
|
9
|
+
# 0.0.3
|
10
|
+
|
11
|
+
- Change the scope of the .tipsy selector as it's inserted outside of the Glimpse div.
|
12
|
+
|
13
|
+
# 0.0.4
|
14
|
+
|
15
|
+
- Don't capture ` being pressed when in combination with `cmd`
|
16
|
+
- Support for [Turbolinks](https://github.com/rails/turbolinks) (#14)
|
17
|
+
|
18
|
+
# 0.0.5
|
19
|
+
|
20
|
+
- Namespace the tooltips to the `.glimpse-tooltip` class name to not conflict with any application styles for `.tooltip`. (#18)
|
21
|
+
|
22
|
+
# 0.0.6
|
23
|
+
|
24
|
+
- Added Peek::Views::View#parse_options that gets called within initialize for subclasses to use to parse their options.
|
25
|
+
|
26
|
+
# 0.1.0
|
27
|
+
|
28
|
+
- Introduced a new JS event `peek:render` that includes the request id and request payload data that is used to update the information in the bar.
|
29
|
+
- Request information has moved from the `peek/results` partial to an AJAX request that happens on page load, and when PJAX/Turbolinks change pages.
|
30
|
+
- Removed the need for `peek/results` partial.
|
31
|
+
- Introduced a Redis and Memcache adapter for multi-server environments to store request payloads.
|
32
|
+
- Tooltips automatically repositions depending on where the Peek bar is.
|
33
|
+
|
34
|
+
# 0.1.1
|
35
|
+
|
36
|
+
- Fix bug with how `peek:render` was passing arguments around.
|
37
|
+
|
38
|
+
# 0.1.2
|
39
|
+
|
40
|
+
- Fix path to memcache adapter - [#34](https://github.com/peek/peek/pull/34) [@grk](https://github.com/grk)
|
41
|
+
- Prevent namespace collision when using [peek-dalli](https://github.com/peek/peek-dalli) - [#34](https://github.com/peek/peek/pull/34) [@grk](https://github.com/grk)
|
42
|
+
|
43
|
+
# 0.1.3
|
44
|
+
|
45
|
+
- Remove Redis dependency from Gemfile
|
46
|
+
|
47
|
+
# 0.1.4
|
48
|
+
|
49
|
+
- Don't access xhr object when not present in pjax:end
|
50
|
+
|
51
|
+
# 0.1.5
|
52
|
+
|
53
|
+
- Don't trigger `peek:update` event when the peek bar isn't present - [#37](https://github.com/peek/peek/issues/37) [@dewski](https://github.com/dewski)
|
54
|
+
- Add `after_request` helper method for Peek::Views::View to help reset state
|
55
|
+
|
56
|
+
# 0.1.6
|
57
|
+
|
58
|
+
- Use `event.which` for normalization between `event.keyCode` and `event.charCode` - [#38](https://github.com/peek/peek/pull/38) [@leongersing](https://github.com/leongersing)
|
59
|
+
|
60
|
+
# 0.1.7
|
61
|
+
|
62
|
+
- Support all Rails 3.x.x versions by not using `request.uuid` instead `env` - [#39](https://github.com/peek/peek/pull/39) [@bryanmikaelian](https://github.com/bryanmikaelian)
|
63
|
+
|
64
|
+
# 0.1.8
|
65
|
+
|
66
|
+
- Include the ControllerHelpers directly into `ActionController::Base` - [#41](https://github.com/peek/peek/pull/41) [@lucasmazza](https://github.com/lucasmazza)
|
67
|
+
|
68
|
+
# 0.1.9
|
69
|
+
|
70
|
+
- Rescue & log Dalli exceptions instead of crashing - [#50](https://github.com/peek/peek/pull/50) [@barunio](https://github.com/barunio)
|
71
|
+
|
72
|
+
# 0.1.10
|
73
|
+
|
74
|
+
- Take off Responders - [#65](https://github.com/peek/peek/pull/65) [@nwjsmith](https://github.com/nwjsmith)
|
75
|
+
|
76
|
+
# 0.2.0
|
77
|
+
|
78
|
+
- Add image dependencies for asset compilation - [#67](https://github.com/peek/peek/pull/67) [@fedesoria](https://github.com/fedesoria)
|
79
|
+
- Update JSON to 1.8.2 for compatibility with Ruby 2.2.2 - [#73](https://github.com/peek/peek/pull/73) [@eitoball](https://github.com/eitoball)
|
80
|
+
- Use concurrent-ruby gem in favor of deprecated atomic gem. - [#73](https://github.com/peek/peek/pull/73) [@eitoball](https://github.com/eitoball)
|
81
|
+
- Prevent errors if compatibility mode is enabled for jQuery - [#74](https://github.com/peek/peek/pull/74) [@warseph](https://github.com/warseph)
|
82
|
+
- Add dependency for coffee-rails for Rails. - [#80](https://github.com/peek/peek/pull/80) [@cllns](https://github.com/cllns)
|
83
|
+
- Fix deprecation warnings for `helper_method` for future versions of Rails past Rails v5. - [#85](https://github.com/peek/peek/pull/85) [@mgrachev](https://github.com/mgrachev)
|
84
|
+
- Listen to Turbolinks v5 `turbolinks:load` JS event to trigger peek updates. - [#88](https://github.com/peek/peek/pull/88) [@lucasmazza](https://github.com/lucasmazza)
|
85
|
+
|
86
|
+
# 1.0
|
87
|
+
|
88
|
+
- Rails 4+ compatibility
|
89
|
+
- Update `before_filter` to `before_action` @mkcode
|
90
|
+
- Replace GIFs with colors @tarebyte
|
91
|
+
- Remove CoffeeScript @dewski
|
92
|
+
- Use Ruby JSON syntax for hashes
|
93
|
+
|
94
|
+
# Next
|
95
|
+
|
96
|
+
- Ensure that Peek can handle concurrent requests with a multithreaded application server
|
data/Gemfile
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in peek.gemspec
|
4
|
+
gemspec
|
5
|
+
|
6
|
+
gem 'rake'
|
7
|
+
gem 'json', '~> 2.0', '>= 2.0.2'
|
8
|
+
|
9
|
+
# For the test application
|
10
|
+
gem 'rails', '~> 5.0', '>= 5.0.0.1'
|
11
|
+
gem 'concurrent-ruby', '>= 0.9.0'
|
12
|
+
gem 'concurrent-ruby-ext', '>= 0.9.0'
|
13
|
+
|
14
|
+
# Use SCSS for stylesheets
|
15
|
+
gem 'sass-rails', '~> 5.0'
|
16
|
+
|
17
|
+
# Use Uglifier as compressor for JavaScript assets
|
18
|
+
gem 'uglifier', '>= 1.3.0'
|
19
|
+
|
20
|
+
# Use CoffeeScript for .js.coffee assets and views
|
21
|
+
gem 'coffee-rails', '~> 4.2'
|
22
|
+
|
23
|
+
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
24
|
+
# gem 'therubyracer', platforms: :ruby
|
25
|
+
|
26
|
+
# Use jquery as the JavaScript library
|
27
|
+
gem 'jquery-rails'
|
28
|
+
|
29
|
+
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
|
30
|
+
gem 'turbolinks'
|
data/Gemfile-rails42
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in peek.gemspec
|
4
|
+
gemspec
|
5
|
+
|
6
|
+
gem 'rake'
|
7
|
+
gem 'json', '~> 1.8.3'
|
8
|
+
|
9
|
+
gem 'rails', '~> 4.2.7.1'
|
10
|
+
|
11
|
+
# Use SCSS for stylesheets
|
12
|
+
gem 'sass-rails', '~> 5.0.0'
|
13
|
+
|
14
|
+
# Use Uglifier as compressor for JavaScript assets
|
15
|
+
gem 'uglifier', '>= 1.3.0'
|
16
|
+
|
17
|
+
# Use CoffeeScript for .js.coffee assets and views
|
18
|
+
gem 'coffee-rails', '~> 4.1.0'
|
19
|
+
|
20
|
+
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
21
|
+
# gem 'therubyracer', platforms: :ruby
|
22
|
+
|
23
|
+
# Use jquery as the JavaScript library
|
24
|
+
gem 'jquery-rails'
|
25
|
+
|
26
|
+
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
|
27
|
+
gem 'turbolinks'
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Garrett Bjerkhoel
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,253 @@
|
|
1
|
+
# Peek
|
2
|
+
|
3
|
+
## Fork notice
|
4
|
+
|
5
|
+
This is a fork of https://github.com/peek/peek to support multi-threaded
|
6
|
+
application servers, like Puma. The upstream pull request to add this is
|
7
|
+
https://github.com/peek/peek/pull/113.
|
8
|
+
|
9
|
+
This repo is a pull mirror of https://github.com/smcgivern/peek, the
|
10
|
+
source repository for that PR.
|
11
|
+
|
12
|
+
## Original README
|
13
|
+
|
14
|
+
[![Build Status](https://travis-ci.org/peek/peek.svg?branch=master)](https://travis-ci.org/peek/peek) [![Gem Version](https://badge.fury.io/rb/peek.svg)](http://badge.fury.io/rb/peek) [![Inline docs](http://inch-ci.org/github/peek/peek.svg)](http://inch-ci.org/github/peek/peek)
|
15
|
+
|
16
|
+
Take a peek into your Rails application.
|
17
|
+
|
18
|
+
![Preview](https://f.cloud.github.com/assets/79995/244991/03cee1fa-8a74-11e2-8e33-283cf1298a60.png)
|
19
|
+
|
20
|
+
This is a profiling tool originally built at GitHub to help us get an insight into our application. Now, we have extracted this into Peek, so that other Rails application can experience the same benefit.
|
21
|
+
|
22
|
+
Peek puts a little bar on top of your application to show you all sorts of helpful information about your application. From the screenshot above, you can see that Peek provides information about database queries, cache, Resque workers and more. However, this is only part of Peek's beauty.
|
23
|
+
|
24
|
+
The true beauty of Peek lies in the fact that it is an extensible platform. If there are some performance metrics that you need but are not available on Peek, you can find it from the list of available [Peek Views](#available-peek-views) and integrate it into Peek. Even if you do not find what you want on Peek Views, you can always [create your own](#creating-your-own-peek-item).
|
25
|
+
|
26
|
+
## Installation
|
27
|
+
|
28
|
+
Add this line to your application's Gemfile:
|
29
|
+
|
30
|
+
gem 'peek'
|
31
|
+
|
32
|
+
And then execute:
|
33
|
+
|
34
|
+
$ bundle
|
35
|
+
|
36
|
+
Or install it yourself as:
|
37
|
+
|
38
|
+
$ gem install peek
|
39
|
+
|
40
|
+
## Usage
|
41
|
+
|
42
|
+
Now that Peek is installed, you'll need to mount the engine within your `config/routes.rb`
|
43
|
+
file:
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
Some::Application.routes.draw do
|
47
|
+
mount Peek::Railtie => '/peek'
|
48
|
+
root to: 'home#show'
|
49
|
+
end
|
50
|
+
```
|
51
|
+
|
52
|
+
To pick which views you want to see in your Peek bar, just create a file at
|
53
|
+
`config/initializers/peek.rb` that has a list of the views you'd like to include:
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
Peek.into Peek::Views::Git, nwo: 'github/janky'
|
57
|
+
Peek.into Peek::Views::Mysql2
|
58
|
+
Peek.into Peek::Views::Redis
|
59
|
+
Peek.into Peek::Views::Dalli
|
60
|
+
```
|
61
|
+
|
62
|
+
Feel free to pick and install from the [list](https://github.com/peek/peek#available-peek-views) or create your own. The order they
|
63
|
+
are added to Peek, the order they will appear in your bar.
|
64
|
+
|
65
|
+
Next, to render the Peek bar in your application just add the following snippet
|
66
|
+
just after the opening `<body>` tag in your application layout.
|
67
|
+
|
68
|
+
```erb
|
69
|
+
<%= render 'peek/bar' %>
|
70
|
+
```
|
71
|
+
|
72
|
+
It will look like:
|
73
|
+
|
74
|
+
```erb
|
75
|
+
<html>
|
76
|
+
<head>
|
77
|
+
<title>Application</title>
|
78
|
+
</head>
|
79
|
+
<body>
|
80
|
+
<%= render 'peek/bar' %>
|
81
|
+
<%= yield %>
|
82
|
+
</body>
|
83
|
+
</html>
|
84
|
+
```
|
85
|
+
|
86
|
+
Peek fetches the data collected throughout your requests by using the unique request id
|
87
|
+
that was assigned to the request by Rails. It will call out to its own controller at
|
88
|
+
[Peek::ResultsController](https://github.com/peek/peek/blob/master/app/controllers/peek/results_controller.rb) which will render the data and be inserted into the bar.
|
89
|
+
|
90
|
+
Now that you have the partials in your application, you will need to include the
|
91
|
+
CSS and JS that help make Peek :sparkles:
|
92
|
+
|
93
|
+
In `app/assets/stylesheets/application.scss`:
|
94
|
+
|
95
|
+
```scss
|
96
|
+
//= require peek
|
97
|
+
```
|
98
|
+
|
99
|
+
In `app/assets/javascripts/application.coffee`:
|
100
|
+
|
101
|
+
```coffeescript
|
102
|
+
#= require jquery
|
103
|
+
#= require jquery_ujs
|
104
|
+
#= require peek
|
105
|
+
```
|
106
|
+
|
107
|
+
Note: Each additional view may have their own CSS and JS that you may need to require
|
108
|
+
which should be stated in their usage documentation.
|
109
|
+
|
110
|
+
### Configuring the default adapter
|
111
|
+
|
112
|
+
For Peek to work, it keeps track of all requests made in your application
|
113
|
+
so it can report back and display that information in the Peek bar. By default
|
114
|
+
it stores this information in memory, which is not recommended for production environments.
|
115
|
+
|
116
|
+
In production environments you may have application servers on multiple hosts,
|
117
|
+
at which Peek will not be able to access the request data if it was saved in memory on
|
118
|
+
another host. Peek provides 2 additional adapters for multi server environments.
|
119
|
+
|
120
|
+
You can configure which adapter Peek uses by updating your application
|
121
|
+
config or an individual environment config file. We'll use production as an example.
|
122
|
+
|
123
|
+
Note: Peek does not provide the dependencies for each of these adapters. If you use these
|
124
|
+
adapters be sure to include their dependencies in your application.
|
125
|
+
|
126
|
+
- Redis - The [redis](https://github.com/redis/redis-rb) gem
|
127
|
+
- Dalli - The [dalli](https://github.com/mperham/dalli) gem
|
128
|
+
- Elasticsearch - The [elasticsearch](https://github.com/elasticsearch/elasticsearch-ruby) gem
|
129
|
+
|
130
|
+
```ruby
|
131
|
+
Peeked::Application.configure do
|
132
|
+
# ...
|
133
|
+
|
134
|
+
# Redis with no options
|
135
|
+
config.peek.adapter = :redis
|
136
|
+
|
137
|
+
# Redis with options
|
138
|
+
config.peek.adapter = :redis, {
|
139
|
+
client: Redis.new,
|
140
|
+
expires_in: 60 * 30 # => 30 minutes in seconds
|
141
|
+
}
|
142
|
+
|
143
|
+
# Memcache with no options
|
144
|
+
config.peek.adapter = :memcache
|
145
|
+
|
146
|
+
# Memcache with options
|
147
|
+
config.peek.adapter = :memcache, {
|
148
|
+
client: Dalli::Client.new,
|
149
|
+
expires_in: 60 * 30 # => 30 minutes in seconds
|
150
|
+
}
|
151
|
+
|
152
|
+
# Elasticsearch with no options
|
153
|
+
config.peek.adapter = :elasticsearch
|
154
|
+
|
155
|
+
# Elasticsearch with options
|
156
|
+
config.peek.adapter = :elasticsearch, {
|
157
|
+
client: Elasticsearch::Client.new,
|
158
|
+
expires_in: 60 * 30, # => 30 minutes in seconds
|
159
|
+
index: 'peek_requests_index',
|
160
|
+
type: 'peek_request'
|
161
|
+
}
|
162
|
+
|
163
|
+
# ...
|
164
|
+
end
|
165
|
+
```
|
166
|
+
|
167
|
+
Peek doesn't persist the request data forever. It uses a safe 30 minute cache
|
168
|
+
length that way data will be available if you'd like to aggregate it or
|
169
|
+
use it for other Peek views. You can update this to be 30 seconds if you don't
|
170
|
+
want the data to be available to stick around.
|
171
|
+
|
172
|
+
### Customizing the bar
|
173
|
+
|
174
|
+
You can customize the appearance of the bar by customizing it in your own application's CSS.
|
175
|
+
|
176
|
+
One common example is fixing the peek bar to the bottom, rather than top, of a page, for use with [Bootstrap](http://getbootstrap.com/):
|
177
|
+
|
178
|
+
```css
|
179
|
+
#peek {
|
180
|
+
position: fixed;
|
181
|
+
bottom: 0;
|
182
|
+
left: 0;
|
183
|
+
right: 0;
|
184
|
+
z-index: 999;
|
185
|
+
}
|
186
|
+
```
|
187
|
+
|
188
|
+
## Using Peek with PJAX
|
189
|
+
|
190
|
+
It just works.
|
191
|
+
|
192
|
+
## Using Peek with Turbolinks
|
193
|
+
|
194
|
+
It just works.
|
195
|
+
|
196
|
+
## Access Control
|
197
|
+
|
198
|
+
Peek will only render in development and staging environments. If you'd
|
199
|
+
like to whitelist a select number of users to view Peek in production you
|
200
|
+
can override the `peek_enabled?` guard in `ApplicationController`:
|
201
|
+
|
202
|
+
```ruby
|
203
|
+
class ApplicationController < ActionController::Base
|
204
|
+
def peek_enabled?
|
205
|
+
current_user.staff?
|
206
|
+
end
|
207
|
+
end
|
208
|
+
```
|
209
|
+
|
210
|
+
## Available Peek views
|
211
|
+
|
212
|
+
- [peek-active_resource](https://github.com/gotmayonase/peek-active_resource)
|
213
|
+
- [peek-alt-routes](https://github.com/mkcode/peek-alt-routes)
|
214
|
+
- [peek-dalli](https://github.com/peek/peek-dalli)
|
215
|
+
- [peek-delayed_job](https://github.com/18F/peek-delayed_job)
|
216
|
+
- [peek-faraday](https://github.com/grk/peek-faraday)
|
217
|
+
- [peek-flexirest](https://github.com/andyjeffries/peek-flexirest)
|
218
|
+
- [peek-gc](https://github.com/peek/peek-gc)
|
219
|
+
- [peek-git](https://github.com/peek/peek-git)
|
220
|
+
- [peek-host](https://github.com/jacobbednarz/peek-host)
|
221
|
+
- [peek-mongo](https://github.com/peek/peek-mongo)
|
222
|
+
- [peek-moped](https://github.com/nodkz/peek-moped)
|
223
|
+
- [peek-mysql2](https://github.com/peek/peek-mysql2)
|
224
|
+
- [peek-performance_bar](https://github.com/peek/peek-performance_bar)
|
225
|
+
- [peek-pg](https://github.com/peek/peek-pg)
|
226
|
+
- [peek-rblineprof](https://github.com/peek/peek-rblineprof)
|
227
|
+
- [peek-redis](https://github.com/peek/peek-redis)
|
228
|
+
- [peek-resque](https://github.com/peek/peek-resque)
|
229
|
+
- [peek-sidekiq](https://github.com/suranyami/peek-sidekiq)
|
230
|
+
- [peek-svn](https://github.com/neilco/peek-svn)
|
231
|
+
- Unicorn :soon:
|
232
|
+
|
233
|
+
Feel free to submit a Pull Request adding your own Peek item to this list.
|
234
|
+
|
235
|
+
## Creating your own Peek item
|
236
|
+
|
237
|
+
Each Peek item is a self contained Rails engine which gives you the power to
|
238
|
+
use all features of Ruby on Rails to dig in deep within your application and
|
239
|
+
report it back to the Peek bar. A Peek item is just a custom class that
|
240
|
+
is responsible for fetching and building the data that should be reported back
|
241
|
+
to the user.
|
242
|
+
|
243
|
+
There are still some docs to be written, but if you'd like to checkout a simple
|
244
|
+
example of how to create your own, just checkout [peek-git](https://github.com/peek/peek-git).
|
245
|
+
To just look at an example view, there is [Peek::Views::Git](https://github.com/peek/peek-git/blob/master/lib/peek/views/git.rb).
|
246
|
+
|
247
|
+
## Contributing
|
248
|
+
|
249
|
+
1. Fork it
|
250
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
251
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
252
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
253
|
+
5. Create new Pull Request
|