redu 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/redu/analyzer.rb +20 -17
- data/lib/redu/version.rb +1 -1
- metadata +3 -3
data/lib/redu/analyzer.rb
CHANGED
@@ -168,25 +168,28 @@ module Redu
|
|
168
168
|
end
|
169
169
|
|
170
170
|
def analyze_key(key)
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
prefix
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
171
|
+
begin
|
172
|
+
obj_str = @redis.debug("OBJECT", key)
|
173
|
+
|
174
|
+
rdo = RedisDebugObject.initialize_from_string(key,obj_str)
|
175
|
+
|
176
|
+
prefix_str = derive_prefix(key)
|
177
|
+
if prefix_str
|
178
|
+
prefix = @prefixes[prefix_str]
|
179
|
+
if !prefix
|
180
|
+
prefix = KeyPrefix.new
|
181
|
+
prefix.count = 1
|
182
|
+
prefix.bytesize = rdo.bytesize
|
183
|
+
@prefixes[prefix_str] = prefix
|
184
|
+
else
|
185
|
+
prefix.count += 1
|
186
|
+
prefix.bytesize += rdo.bytesize
|
187
|
+
end
|
186
188
|
end
|
189
|
+
|
190
|
+
@worst_offender_set.add(rdo)
|
191
|
+
rescue # Many times a key will be gone by the time we get to it in the array
|
187
192
|
end
|
188
|
-
|
189
|
-
@worst_offender_set.add(rdo)
|
190
193
|
end
|
191
194
|
end
|
192
195
|
end
|
data/lib/redu/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 4
|
9
|
+
version: 0.0.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Curtis Spencer
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2012-02-
|
17
|
+
date: 2012-02-07 00:00:00 -08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|