lens 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/lens/event_formatter.rb +1 -0
- data/lib/lens/sender.rb +1 -1
- data/lib/lens/trace.rb +3 -3
- data/lib/lens/version.rb +1 -1
- data/spec/lens/event_formatter_spec.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ae1d1e74e8a915445f14d4ab362a20f99a248b1
|
4
|
+
data.tar.gz: 13ac21b192e48507bffca37a8ad7888856ac63ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c46fe144edb80f0af68d13533be1238eed71ae37b2e899039079cadfc0afc73c7d627eda7a5bb2808471b30ebd18fb6e74098a039752a1b50194d383c4a818d
|
7
|
+
data.tar.gz: 0354d0099fec1e87a9a2b4e929d5686b252d259136c739082a9aaf04b5765bd4f4bb5a40ff550e2aa89262d8242109b1b23ed644ebd043bf40456ff02c3ade9e
|
data/Gemfile.lock
CHANGED
data/lib/lens/event_formatter.rb
CHANGED
data/lib/lens/sender.rb
CHANGED
data/lib/lens/trace.rb
CHANGED
@@ -8,13 +8,13 @@ module Lens
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def add(event)
|
11
|
-
@data.push event.payload
|
11
|
+
@data.push event.payload.merge(duration: event.duration)
|
12
12
|
end
|
13
13
|
|
14
14
|
def complete(event)
|
15
15
|
formatted_data = Lens::EventFormatter.new(event, @data).json_formatted
|
16
|
-
log(
|
17
|
-
send(
|
16
|
+
log(formatted_data)
|
17
|
+
send(formatted_data)
|
18
18
|
Thread.current[:__lens_trace] = nil
|
19
19
|
end
|
20
20
|
|
data/lib/lens/version.rb
CHANGED
@@ -19,5 +19,10 @@ describe Lens::EventFormatter do
|
|
19
19
|
it "data key is not empty" do
|
20
20
|
expect(subject[:data]).to_not be_empty
|
21
21
|
end
|
22
|
+
|
23
|
+
it "required fields are present" do
|
24
|
+
required_keys = [:action, :controller, :params, :method, :url, :records, :time, :duration]
|
25
|
+
expect(required_keys - subject[:data].keys).to be_empty
|
26
|
+
end
|
22
27
|
end
|
23
28
|
end
|