peep 0.6 → 0.7

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- =��f����Mq�j�g
2
- �����`mo@�$F�+�ck-��8��u'm���I5��c�N�
1
+ �~��S��
2
+ n�� ���Y�s�s�0ad@�h*�<�ԟ��PR�"8��K��2�wZѠmy�JZ�@,��`��qV���ލ��:H)!I�/����Ą��;�)3�@��������(yR,����]݂<����@�I�z:cPr�o:2 S�\F=̈́�5F�7�2ٍ]���!}`:R��E�-����V���1L�7N{nS�t���F���0�H��
data/CHANGELOG CHANGED
@@ -1,4 +1,6 @@
1
1
 
2
+ v0.7. Memcached 1.4.5 compatibility.
3
+
2
4
  v0.6. Memcached 1.2.8 compatibility.
3
5
 
4
6
  v0.5. First release.
data/README CHANGED
@@ -17,7 +17,7 @@ x86 Linux is required.
17
17
 
18
18
  You need {memcached}[http://www.danga.com/memcached/] compiled with debugging symbols:
19
19
 
20
- CFLAGS='-g' ./configure --enable-threads
20
+ CFLAGS='-g' ./configure
21
21
  make
22
22
  sudo make install
23
23
 
data/bin/peep CHANGED
@@ -5,7 +5,7 @@ require "rubygems"
5
5
  require "peep"
6
6
 
7
7
  pretty = true
8
- format = "%10s |%10s |%8s |%8s |%5s |%6s |%5s |%75s |%6s |%7s\n"
8
+ format = "%10s |%10s |%8s |%8s |%11s |%6s |%5s |%75s |%6s |%7s\n"
9
9
 
10
10
  if ARGV.first == '--ugly'
11
11
  pretty = false
data/ext/ptrace.c CHANGED
@@ -5,6 +5,7 @@
5
5
  #include <sys/user.h>
6
6
  #include <sys/ptrace.h>
7
7
  #include <linux/ptrace.h>
8
+ #include <stdbool.h>
8
9
 
9
10
  #include "ruby.h"
10
11
  #include "rubyio.h"
@@ -60,8 +61,6 @@ static VALUE stats_offsets () {
60
61
  STATS_(get_hits);
61
62
  STATS_(get_misses);
62
63
  STATS_(started);
63
- STATS_(bytes_read);
64
- STATS_(bytes_written);
65
64
 
66
65
  rb_hash_freeze(p_hash);
67
66
  return p_hash;
data/lib/peep/peep.rb CHANGED
@@ -36,7 +36,7 @@ module Peep
36
36
  def init_addresses
37
37
  @addresses = {}
38
38
  IO.popen("gdb -q memcached #{pid}", "w+") do |gdb|
39
- %w(primary_hashtable hash_items hashpower stats settings).each do | key|
39
+ %w(primary_hashtable hash_items hashpower stats settings process_started).each do | key|
40
40
  gdb.puts "p &#{key}"
41
41
  1 while (line = gdb.gets) !~ /\(gdb\)/
42
42
  @addresses[key] = line.split.last.hex
@@ -70,7 +70,8 @@ module Peep
70
70
  {
71
71
  'hashtable' => read_long(addresses['primary_hashtable']),
72
72
  'hash_items' => read_long(addresses['hash_items']),
73
- 'hashpower' => read_int(addresses['hashpower'])
73
+ 'hashpower' => read_int(addresses['hashpower']),
74
+ 'process_started' => read_long(addresses['process_started'])
74
75
  }
75
76
  end
76
77
  end
@@ -105,9 +106,13 @@ module Peep
105
106
  end
106
107
 
107
108
  IT_FLAGS = {
108
- 1 => "link",
109
- 2 => "del",
110
- 4 => "slab"
109
+ 1 => "LINKED",
110
+ 2 => "CAS",
111
+ 3 => "LINKED CAS",
112
+ 4 => "SLABBED",
113
+ 5 => "LINKED SLABBED",
114
+ 6 => "SLABBED CAS",
115
+ 7 => "LINKED SLABBED CAS"
111
116
  }
112
117
 
113
118
  HEADER = ['time', 'exptime', 'nbytes', 'nsuffix', 'it_f', 'clsid', 'nkey', 'key', 'exprd', 'flushd']
@@ -115,7 +120,7 @@ module Peep
115
120
  def items
116
121
  basics
117
122
 
118
- now = Time.now.to_i - stats['started']
123
+ now = Time.now.to_i - basics['process_started']
119
124
  flushed = settings['oldest_live']
120
125
  items = []
121
126
 
@@ -131,10 +136,10 @@ module Peep
131
136
  exptime = read_int(bucket + ITEM_OFFSETS['exptime']),
132
137
  read_int(bucket + ITEM_OFFSETS['nbytes']),
133
138
  read_uint8(bucket + ITEM_OFFSETS['nsuffix']),
134
- IT_FLAGS[read_uint8(bucket + ITEM_OFFSETS['it_flags'])],
139
+ IT_FLAGS[it_flags = read_uint8(bucket + ITEM_OFFSETS['it_flags'])],
135
140
  read_uint8(bucket + ITEM_OFFSETS['slabs_clsid']),
136
141
  nkey = read_uint8(bucket + ITEM_OFFSETS['nkey']),
137
- read_bytes(bucket + ITEM_OFFSETS['end'], nkey),
142
+ read_bytes(bucket + ITEM_OFFSETS['end'] + (it_flags & 2 ? 8 : 0), nkey),
138
143
 
139
144
  !(exptime.zero? or now < exptime), # expired?
140
145
  !(flushed.zero? or flushed < time) # flushed?
data/peep.gemspec CHANGED
@@ -2,12 +2,12 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{peep}
5
- s.version = "0.6"
5
+ s.version = "0.7"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Evan Weaver"]
9
9
  s.cert_chain = ["/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-public_cert.pem"]
10
- s.date = %q{2009-11-18}
10
+ s.date = %q{2011-02-16}
11
11
  s.default_executable = %q{peep}
12
12
  s.description = %q{A heap inspector for live memcached instances.}
13
13
  s.email = %q{}
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Peep", "--main", "README"]
20
20
  s.require_paths = ["lib", "ext"]
21
21
  s.rubyforge_project = %q{fauna}
22
- s.rubygems_version = %q{1.3.5}
22
+ s.rubygems_version = %q{1.3.7}
23
23
  s.signing_key = %q{/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-private_key.pem}
24
24
  s.summary = %q{A heap inspector for live memcached instances.}
25
25
 
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
27
27
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
28
28
  s.specification_version = 3
29
29
 
30
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
30
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
31
31
  else
32
32
  end
33
33
  else
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peep
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.6"
4
+ hash: 5
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 7
9
+ version: "0.7"
5
10
  platform: ruby
6
11
  authors:
7
12
  - Evan Weaver
@@ -30,7 +35,7 @@ cert_chain:
30
35
  yZ0=
31
36
  -----END CERTIFICATE-----
32
37
 
33
- date: 2009-11-18 00:00:00 -08:00
38
+ date: 2011-02-16 00:00:00 -08:00
34
39
  default_executable:
35
40
  dependencies: []
36
41
 
@@ -75,21 +80,28 @@ require_paths:
75
80
  - lib
76
81
  - ext
77
82
  required_ruby_version: !ruby/object:Gem::Requirement
83
+ none: false
78
84
  requirements:
79
85
  - - ">="
80
86
  - !ruby/object:Gem::Version
87
+ hash: 3
88
+ segments:
89
+ - 0
81
90
  version: "0"
82
- version:
83
91
  required_rubygems_version: !ruby/object:Gem::Requirement
92
+ none: false
84
93
  requirements:
85
94
  - - ">="
86
95
  - !ruby/object:Gem::Version
96
+ hash: 11
97
+ segments:
98
+ - 1
99
+ - 2
87
100
  version: "1.2"
88
- version:
89
101
  requirements: []
90
102
 
91
103
  rubyforge_project: fauna
92
- rubygems_version: 1.3.5
104
+ rubygems_version: 1.3.7
93
105
  signing_key:
94
106
  specification_version: 3
95
107
  summary: A heap inspector for live memcached instances.
metadata.gz.sig CHANGED
@@ -1,2 +1,6 @@
1
- vYV"mw����*/,�;7��;�ǎ�vΧ%�̜G�������Zň�.�p��u,$��� ^�;�2c+��Rl%7��:�5���8������k1O���e�on:AGb5%�Y��(
2
- H)5�'�'frpnۀ
1
+ ����h���XD녞۫��Oe(e�ik��a���R��KD`�Ѓ��Ϗ�+�7���
2
+ 49�'jw9�
3
+ P,�6-͓��Y ���~��=Y�UMFalB��bb��8���ߔ��<��E���Ul0��l�� �6�)}J���
4
+ '�D�0٢�|#�<��mj�!S����|r谄�z0\x\�_���
5
+ �,�!]꼳�/�ƥ 4F1w3����љ~�P��'Md(J;�ܼ��%�
6
+ �]��%�~XDnȽ�$