peek-dalli 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: aaeba1370324052423136eaedd78635379fb835b
4
+ data.tar.gz: d0478471396f1da47df5fd200892a65688bb6432
5
+ SHA512:
6
+ metadata.gz: e834dd7eb7924284e5bfe2a91d685770f23c982dc7c5be3374c747c7700e6b83df1e79599f1bf6df84799a41861b9b4500a880608c0e17eec14c494fed5a1441
7
+ data.tar.gz: c5a5e6ce365e892ffaa8c0de78e32799bb7a7039ebffe48f555ac4beb7e3bd1bb3e1026459ca471fbcc8900345cb29bf829eae235ddf4c30362f07359c7b0554
data/CHANGELOG.md CHANGED
@@ -13,3 +13,9 @@
13
13
  # 1.1.2
14
14
 
15
15
  - Add CoffeeScript for tooltip context
16
+
17
+ # 1.1.3
18
+
19
+ - Rename label from dalli to memcache - #6 @twe4ked
20
+ - Capture "other" cache related notifications - #5 @twe4ked
21
+ - Display durations more than 1000ms in seconds - #3 @jonah-williams
@@ -3,6 +3,7 @@ $(document).on 'peek:render', (event, requestId, data) ->
3
3
  title.push("Reads: #{data.context.dalli.reads}")
4
4
  title.push("Misses: #{data.context.dalli.misses}")
5
5
  title.push("Writes: #{data.context.dalli.writes}")
6
+ title.push("Other: #{data.context.dalli.others}")
6
7
 
7
8
  $('#peek-dalli-tooltip')
8
9
  .attr('title', title.join('<br>'))
@@ -2,4 +2,4 @@
2
2
  <span id="peek-dalli-tooltip">
3
3
  <span data-defer-to="<%= view.defer_key %>-duration">...</span> / <span data-defer-to="<%= view.defer_key %>-calls">...</span>
4
4
  </span>
5
- </strong> dalli
5
+ </strong> memcache
@@ -1,5 +1,5 @@
1
1
  module Peek
2
2
  module Dalli
3
- VERSION = '1.1.2'
3
+ VERSION = '1.1.3'
4
4
  end
5
5
  end
@@ -10,6 +10,7 @@ module Peek
10
10
  @reads = Atomic.new(0)
11
11
  @misses = Atomic.new(0)
12
12
  @writes = Atomic.new(0)
13
+ @others = Atomic.new(0)
13
14
 
14
15
  setup_subscribers
15
16
  end
@@ -17,7 +18,7 @@ module Peek
17
18
  def formatted_duration
18
19
  ms = @duration.value * 1000
19
20
  if ms >= 1000
20
- "%.2fms" % ms
21
+ "%.2fs" % (ms / 1e3)
21
22
  else
22
23
  "%.0fms" % ms
23
24
  end
@@ -27,14 +28,15 @@ module Peek
27
28
  {
28
29
  :reads => @reads.value,
29
30
  :misses => @misses.value,
30
- :writes => @writes.value
31
+ :writes => @writes.value,
32
+ :others => @others.value,
31
33
  }
32
34
  end
33
35
 
34
36
  def results
35
37
  {
36
38
  :duration => formatted_duration,
37
- :calls => @calls.value
39
+ :calls => @calls.value,
38
40
  }
39
41
  end
40
42
 
@@ -49,21 +51,21 @@ module Peek
49
51
  @reads.value = 0
50
52
  @misses.value = 0
51
53
  @writes.value = 0
52
- end
53
-
54
- subscribe('cache_read.active_support') do
55
- @reads.update { |value| value + 1 }
56
- end
57
-
58
- subscribe('cache_miss.active_support') do
59
- @misses.update { |value| value + 1 }
60
- end
61
-
62
- subscribe('cache_write.active_support') do
63
- @writes.update { |value| value + 1 }
54
+ @others.value = 0
64
55
  end
65
56
 
66
57
  subscribe(/cache_(.*).active_support/) do |name, start, finish, id, payload|
58
+ case name
59
+ when 'cache_read.active_support'
60
+ @reads.update { |value| value + 1 }
61
+ when 'cache_miss.active_support'
62
+ @misses.update { |value| value + 1 }
63
+ when 'cache_write.active_support'
64
+ @writes.update { |value| value + 1 }
65
+ else
66
+ @others.update { |value| value + 1 }
67
+ end
68
+
67
69
  duration = (finish - start)
68
70
  @duration.update { |value| value + duration }
69
71
  @calls.update { |value| value + 1 }
metadata CHANGED
@@ -1,62 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peek-dalli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
5
- prerelease:
4
+ version: 1.1.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Garrett Bjerkhoel
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-06-24 00:00:00.000000000 Z
11
+ date: 2015-10-30 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: peek
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: dalli
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: atomic
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: 1.0.0
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: 1.0.0
62
55
  description: Take a peek into the Memcache commands made through Dalli during your
@@ -67,7 +60,7 @@ executables: []
67
60
  extensions: []
68
61
  extra_rdoc_files: []
69
62
  files:
70
- - .gitignore
63
+ - ".gitignore"
71
64
  - CHANGELOG.md
72
65
  - Gemfile
73
66
  - LICENSE.txt
@@ -82,27 +75,26 @@ files:
82
75
  - peek-dalli.gemspec
83
76
  homepage: https://github.com/peek/peek-dalli
84
77
  licenses: []
78
+ metadata: {}
85
79
  post_install_message:
86
80
  rdoc_options: []
87
81
  require_paths:
88
82
  - lib
89
83
  required_ruby_version: !ruby/object:Gem::Requirement
90
- none: false
91
84
  requirements:
92
- - - ! '>='
85
+ - - ">="
93
86
  - !ruby/object:Gem::Version
94
87
  version: '0'
95
88
  required_rubygems_version: !ruby/object:Gem::Requirement
96
- none: false
97
89
  requirements:
98
- - - ! '>='
90
+ - - ">="
99
91
  - !ruby/object:Gem::Version
100
92
  version: '0'
101
93
  requirements: []
102
94
  rubyforge_project:
103
- rubygems_version: 1.8.23
95
+ rubygems_version: 2.2.3
104
96
  signing_key:
105
- specification_version: 3
97
+ specification_version: 4
106
98
  summary: Take a peek into the Memcache commands made through Dalli during your application's
107
99
  requests.
108
100
  test_files: []