peek 0.1.10 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/CHANGELOG.md +14 -0
- data/Gemfile +1 -1
- data/README.md +8 -3
- data/app/assets/javascripts/peek.coffee +67 -65
- data/app/assets/stylesheets/peek.scss +3 -0
- data/lib/peek.rb +2 -2
- data/lib/peek/controller_helpers.rb +3 -3
- data/lib/peek/version.rb +1 -1
- data/peek.gemspec +3 -1
- metadata +35 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef0c9cfcf72331e9ea4fb4a99a13a8e310272134
|
4
|
+
data.tar.gz: fcaa0f1ca750e39bd0b6cf811182ed5555295a85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d03e97811b3ed67445097715013e9443f0ec39e7a7119856d3427e0638ca23638120ea382948881f4776102f7d305ebbdacefc933402d6a464a1439d0a25569
|
7
|
+
data.tar.gz: 93cdb21287730faf3b08fb1c2fabb692cbba9551cc2c14d09af66863537799da751e4c06d9352fabda102fcc16efe1a932e9ed073374fdc897a289ca0bd0e2ba
|
data/.travis.yml
ADDED
data/CHANGELOG.md
CHANGED
@@ -68,3 +68,17 @@
|
|
68
68
|
# 0.1.9
|
69
69
|
|
70
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)
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -6,8 +6,11 @@ Take a peek into your Rails application.
|
|
6
6
|
|
7
7
|
![Preview](https://f.cloud.github.com/assets/79995/244991/03cee1fa-8a74-11e2-8e33-283cf1298a60.png)
|
8
8
|
|
9
|
-
This
|
10
|
-
|
9
|
+
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.
|
10
|
+
|
11
|
+
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.
|
12
|
+
|
13
|
+
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).
|
11
14
|
|
12
15
|
## Installation
|
13
16
|
|
@@ -196,7 +199,10 @@ end
|
|
196
199
|
## Available Peek views
|
197
200
|
|
198
201
|
- [peek-active_resource](https://github.com/gotmayonase/peek-active_resource)
|
202
|
+
- [peek-alt-routes](https://github.com/mkcode/peek-alt-routes)
|
199
203
|
- [peek-dalli](https://github.com/peek/peek-dalli)
|
204
|
+
- [peek-delayed_job](https://github.com/18F/peek-delayed_job)
|
205
|
+
- [peek-faraday](https://github.com/grk/peek-faraday)
|
200
206
|
- [peek-gc](https://github.com/peek/peek-gc)
|
201
207
|
- [peek-git](https://github.com/peek/peek-git)
|
202
208
|
- [peek-host](https://github.com/jacobbednarz/peek-host)
|
@@ -209,7 +215,6 @@ end
|
|
209
215
|
- [peek-redis](https://github.com/peek/peek-redis)
|
210
216
|
- [peek-resque](https://github.com/peek/peek-resque)
|
211
217
|
- [peek-sidekiq](https://github.com/suranyami/peek-sidekiq)
|
212
|
-
- [peek-faraday](https://github.com/grk/peek-faraday)
|
213
218
|
- [peek-svn](https://github.com/neilco/peek-svn)
|
214
219
|
- Unicorn :soon:
|
215
220
|
|
@@ -2,68 +2,70 @@
|
|
2
2
|
|
3
3
|
requestId = null
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
if
|
34
|
-
wrapper
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
$(document).on '
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
$
|
68
|
-
|
69
|
-
|
5
|
+
do ($ = jQuery) ->
|
6
|
+
|
7
|
+
getRequestId = ->
|
8
|
+
if requestId? then requestId else $('#peek').data('request-id')
|
9
|
+
|
10
|
+
peekEnabled = ->
|
11
|
+
$('#peek').length
|
12
|
+
|
13
|
+
updatePerformanceBar = (results) ->
|
14
|
+
for key of results.data
|
15
|
+
for label of results.data[key]
|
16
|
+
$("[data-defer-to=#{key}-#{label}]").text results.data[key][label]
|
17
|
+
$(document).trigger 'peek:render', [getRequestId(), results]
|
18
|
+
|
19
|
+
initializeTipsy = ->
|
20
|
+
$('#peek .peek-tooltip, #peek .tooltip').each ->
|
21
|
+
el = $(this)
|
22
|
+
gravity = if el.hasClass('rightwards') || el.hasClass('leftwards')
|
23
|
+
$.fn.tipsy.autoWE
|
24
|
+
else
|
25
|
+
$.fn.tipsy.autoNS
|
26
|
+
|
27
|
+
el.tipsy
|
28
|
+
gravity: gravity
|
29
|
+
|
30
|
+
toggleBar = (event) ->
|
31
|
+
return if $(event.target).is ':input'
|
32
|
+
|
33
|
+
if event.which == 96 && !event.metaKey
|
34
|
+
wrapper = $('#peek')
|
35
|
+
if wrapper.hasClass 'disabled'
|
36
|
+
wrapper.removeClass 'disabled'
|
37
|
+
document.cookie = "peek=true; path=/";
|
38
|
+
else
|
39
|
+
wrapper.addClass 'disabled'
|
40
|
+
document.cookie = "peek=false; path=/";
|
41
|
+
|
42
|
+
fetchRequestResults = ->
|
43
|
+
$.ajax '/peek/results',
|
44
|
+
data:
|
45
|
+
request_id: getRequestId()
|
46
|
+
success: (data, textStatus, xhr) ->
|
47
|
+
updatePerformanceBar data
|
48
|
+
error: (xhr, textStatus, error) ->
|
49
|
+
# Swallow the error
|
50
|
+
|
51
|
+
$(document).on 'keypress', toggleBar
|
52
|
+
|
53
|
+
$(document).on 'peek:update', initializeTipsy
|
54
|
+
$(document).on 'peek:update', fetchRequestResults
|
55
|
+
|
56
|
+
# Fire the event for our own listeners.
|
57
|
+
$(document).on 'pjax:end', (event, xhr, options) ->
|
58
|
+
if xhr?
|
59
|
+
requestId = xhr.getResponseHeader 'X-Request-Id'
|
60
|
+
|
61
|
+
if peekEnabled()
|
62
|
+
$(this).trigger 'peek:update'
|
63
|
+
|
64
|
+
# Also listen to turbolinks page change event
|
65
|
+
$(document).on 'page:change turbolinks:load', ->
|
66
|
+
if peekEnabled()
|
67
|
+
$(this).trigger 'peek:update'
|
68
|
+
|
69
|
+
$ ->
|
70
|
+
if peekEnabled()
|
71
|
+
$(this).trigger 'peek:update'
|
data/lib/peek.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'peek/version'
|
2
2
|
require 'rails'
|
3
|
-
require '
|
3
|
+
require 'concurrent/atomics'
|
4
4
|
|
5
5
|
require 'peek/adapters/memory'
|
6
6
|
require 'peek/views/view'
|
@@ -9,7 +9,7 @@ module Peek
|
|
9
9
|
ALLOWED_ENVS = ['development', 'staging'].freeze
|
10
10
|
|
11
11
|
def self._request_id
|
12
|
-
@_request_id ||=
|
12
|
+
@_request_id ||= Concurrent::AtomicReference.new
|
13
13
|
end
|
14
14
|
|
15
15
|
def self.request_id
|
@@ -3,14 +3,14 @@ module Peek
|
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
5
|
included do
|
6
|
-
|
7
|
-
helper_method :peek_enabled?
|
6
|
+
prepend_before_action :set_peek_request_id, :if => :peek_enabled?
|
7
|
+
helper_method :peek_enabled? if respond_to? :helper_method
|
8
8
|
end
|
9
9
|
|
10
10
|
protected
|
11
11
|
|
12
12
|
def set_peek_request_id
|
13
|
-
Peek.request_id = env['action_dispatch.request_id']
|
13
|
+
Peek.request_id = request.env['action_dispatch.request_id']
|
14
14
|
end
|
15
15
|
|
16
16
|
def peek_enabled?
|
data/lib/peek/version.rb
CHANGED
data/peek.gemspec
CHANGED
@@ -19,5 +19,7 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.require_paths = ['lib']
|
20
20
|
|
21
21
|
gem.add_dependency 'railties', '>= 3.0.0'
|
22
|
-
gem.add_dependency '
|
22
|
+
gem.add_dependency 'concurrent-ruby', '>= 0.9.0'
|
23
|
+
gem.add_dependency 'concurrent-ruby-ext', '>= 0.9.0'
|
24
|
+
gem.add_dependency 'coffee-rails'
|
23
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: peek
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garrett Bjerkhoel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -25,19 +25,47 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 3.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: concurrent-ruby
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.9.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.9.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: concurrent-ruby-ext
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.9.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.9.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: coffee-rails
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
41
69
|
description: Take a peek into your Rails application.
|
42
70
|
email:
|
43
71
|
- me@garrettbjerkhoel.com
|
@@ -46,6 +74,7 @@ extensions: []
|
|
46
74
|
extra_rdoc_files: []
|
47
75
|
files:
|
48
76
|
- ".gitignore"
|
77
|
+
- ".travis.yml"
|
49
78
|
- CHANGELOG.md
|
50
79
|
- Gemfile
|
51
80
|
- LICENSE.txt
|
@@ -128,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
157
|
version: '0'
|
129
158
|
requirements: []
|
130
159
|
rubyforge_project:
|
131
|
-
rubygems_version: 2.
|
160
|
+
rubygems_version: 2.5.1
|
132
161
|
signing_key:
|
133
162
|
specification_version: 4
|
134
163
|
summary: Take a peek into your Rails application.
|