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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3bd3fd3acc9362105584e5faaeef0fc839cef3d5
4
- data.tar.gz: d3f007fe21318d5b9f56b113a73d8f11a8f05a2e
3
+ metadata.gz: ef0c9cfcf72331e9ea4fb4a99a13a8e310272134
4
+ data.tar.gz: fcaa0f1ca750e39bd0b6cf811182ed5555295a85
5
5
  SHA512:
6
- metadata.gz: 647adb6b09ef5b112df5a3d9153244a320e4f21ee82f13217179523f5baec3747d760ce3f8a880b96d88f5cab14aac13eaf31e95e3a1427fc9fdb496df8dfee4
7
- data.tar.gz: 0e376d75d3e9c14391a4a5aa68c1d8ff26b2bb420a96065e65c4ab2635a970d2d927799261e9cabcbf7da791c28ad80c11246d23160b846bef35380422a05d11
6
+ metadata.gz: 2d03e97811b3ed67445097715013e9443f0ec39e7a7119856d3427e0638ca23638120ea382948881f4776102f7d305ebbdacefc933402d6a464a1439d0a25569
7
+ data.tar.gz: 93cdb21287730faf3b08fb1c2fabb692cbba9551cc2c14d09af66863537799da751e4c06d9352fabda102fcc16efe1a932e9ed073374fdc897a289ca0bd0e2ba
@@ -0,0 +1,2 @@
1
+ before_install:
2
+ - gem install bundler
@@ -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
@@ -4,7 +4,7 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  gem 'rake'
7
- gem 'json', '~> 1.7.7'
7
+ gem 'json', '~> 1.8.2'
8
8
 
9
9
  gem 'rails', '~> 4.0.0.rc1'
10
10
 
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 was originally built at GitHub to help us get insight into what's going
10
- on, this is just an extraction so other Rails applications can have the same.
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
- getRequestId = ->
6
- if requestId? then requestId else $('#peek').data('request-id')
7
-
8
- peekEnabled = ->
9
- $('#peek').length
10
-
11
- updatePerformanceBar = (results) ->
12
- for key of results.data
13
- for label of results.data[key]
14
- $("[data-defer-to=#{key}-#{label}]").text results.data[key][label]
15
- $(document).trigger 'peek:render', [getRequestId(), results]
16
-
17
- initializeTipsy = ->
18
- $('#peek .peek-tooltip, #peek .tooltip').each ->
19
- el = $(this)
20
- gravity = if el.hasClass('rightwards') || el.hasClass('leftwards')
21
- $.fn.tipsy.autoWE
22
- else
23
- $.fn.tipsy.autoNS
24
-
25
- el.tipsy
26
- gravity: gravity
27
-
28
- toggleBar = (event) ->
29
- return if $(event.target).is ':input'
30
-
31
- if event.which == 96 && !event.metaKey
32
- wrapper = $('#peek')
33
- if wrapper.hasClass 'disabled'
34
- wrapper.removeClass 'disabled'
35
- document.cookie = "peek=true; path=/";
36
- else
37
- wrapper.addClass 'disabled'
38
- document.cookie = "peek=false; path=/";
39
-
40
- fetchRequestResults = ->
41
- $.ajax '/peek/results',
42
- data:
43
- request_id: getRequestId()
44
- success: (data, textStatus, xhr) ->
45
- updatePerformanceBar data
46
- error: (xhr, textStatus, error) ->
47
- # Swallow the error
48
-
49
- $(document).on 'keypress', toggleBar
50
-
51
- $(document).on 'peek:update', initializeTipsy
52
- $(document).on 'peek:update', fetchRequestResults
53
-
54
- # Fire the event for our own listeners.
55
- $(document).on 'pjax:end', (event, xhr, options) ->
56
- if xhr?
57
- requestId = xhr.getResponseHeader 'X-Request-Id'
58
-
59
- if peekEnabled()
60
- $(this).trigger 'peek:update'
61
-
62
- # Also listen to turbolinks page change event
63
- $(document).on 'page:change', ->
64
- if peekEnabled()
65
- $(this).trigger 'peek:update'
66
-
67
- $ ->
68
- if peekEnabled()
69
- $(this).trigger 'peek:update'
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'
@@ -1,3 +1,6 @@
1
+ //= depend_on_asset 'peek/bar/production.gif'
2
+ //= depend_on_asset 'peek/bar/staging.gif'
3
+ //= depend_on_asset 'peek/bar/development.gif'
1
4
  //= require peek/vendor/tipsy
2
5
 
3
6
  #peek {
@@ -1,6 +1,6 @@
1
1
  require 'peek/version'
2
2
  require 'rails'
3
- require 'atomic'
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 ||= Atomic.new
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
- prepend_before_filter :set_peek_request_id, :if => :peek_enabled?
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?
@@ -1,3 +1,3 @@
1
1
  module Peek
2
- VERSION = '0.1.10'
2
+ VERSION = '0.2.0'
3
3
  end
@@ -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 'atomic', '>= 1.0.0'
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.1.10
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: 2015-06-23 00:00:00.000000000 Z
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: atomic
28
+ name: concurrent-ruby
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.0.0
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: 1.0.0
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.2.3
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.