daikon 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/daikon.gemspec +1 -1
- data/lib/daikon.rb +1 -1
- data/lib/daikon/monitor.rb +1 -1
- data/spec/monitor_spec.rb +10 -0
- metadata +3 -3
data/daikon.gemspec
CHANGED
data/lib/daikon.rb
CHANGED
data/lib/daikon/monitor.rb
CHANGED
@@ -2,7 +2,7 @@ module Daikon
|
|
2
2
|
class Monitor
|
3
3
|
attr_accessor :queue
|
4
4
|
|
5
|
-
NEW_FORMAT =
|
5
|
+
NEW_FORMAT = /^\+?(\d+\.\d+)( "[A-Z]+".*)/i
|
6
6
|
OLD_SINGLE_FORMAT = /^(QUIT|RANDOMKEY|DBSIZE|EXPIRE|TTL|SAVE|BGSAVE|SHUTDOWN|BGREWRITEAOF|INFO|MONITOR|SLAVEOF)$/i
|
7
7
|
OLD_MORE_FORMAT = /^[A-Z]+ .*$/i
|
8
8
|
|
data/spec/monitor_spec.rb
CHANGED
@@ -23,6 +23,16 @@ describe Daikon::Monitor, "#parse with new format" do
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
+
describe Daikon::Monitor, "#parse with new format that has reply byte" do
|
27
|
+
subject { Daikon::Monitor.new }
|
28
|
+
let(:line) { '+1291699658.994073 "decrby" "fooz" "2000"' }
|
29
|
+
|
30
|
+
it "parses the log into json" do
|
31
|
+
subject.parse(line)
|
32
|
+
subject.queue.should include({:at => 1291699658.994073, :command => '"decrby" "fooz" "2000"'})
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
26
36
|
describe Daikon::Monitor, "#parse with multiple inputs" do
|
27
37
|
subject { Daikon::Monitor.new }
|
28
38
|
before { Timecop.freeze }
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: daikon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 3
|
10
|
+
version: 0.5.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Nick Quaranto
|