request-tracer 0.5.6 → 0.5.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjhhMTU0YjYxYTg5ZTk0NmRjM2U1NzM3MWUwNjFhODc4NjUzZDIwNg==
4
+ ODhiNWZjMmY0OWNiNTk2YTMyYjIyMjMwMWI2NzVmN2M0MmIxZWM0ZQ==
5
5
  data.tar.gz: !binary |-
6
- MTI2MWRiNWE2NmJkNDIwZTgzMjJiYWVjMWZmNGQ5OTRjOGNkMzJkMg==
6
+ MDgyOGNiZjM3NjYxNGEzMmMyN2U0NTI4ZTA0N2M2ZTBmMTc0ODlhYg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OWMyZTJiMmE2ODJhM2E1NTEwZDg3NjYyNTI2YzgwZjY0OGRmM2QwZTY4ZjM5
10
- MTU1MDMzMmVmNWM5NGQxZDFjNjE2MjU0M2JmNWEyMDhhZjg1NDIwZTJkNzlj
11
- Yzk2Zjg2YWQ3ZmRkOTY5ODkyMzUzNzYyNjgwOTU0MDdmZjgxYTk=
9
+ ZGVhYTBiM2MzNzJkMjc3MTVhOTc0MDQxZDc0ZmY4ODg3ODUyMmMyNzU5ZTYx
10
+ MGRmNGQ5OTU4ODI1MTNjODY1OWY0MDJjOGY4NGEwYTNmOTgwODhhMWE3NjNj
11
+ YWMxMTIwNzNlNjJiNWYzYjI2MWEzNTE2NTI2Njc0ZWUxYjE0OTE=
12
12
  data.tar.gz: !binary |-
13
- ZTUxYzlkY2U5NTQ2MGNiMTc2OWRhMDcyYzVjNDRhYWE2NTQ4ZTY1OWRhZTg4
14
- YWZmNTQ4MjZmNzA2MTg1MmQ4YWM3NWExOGRlNWRkOGIwNjllOWI2OGFjNmRm
15
- OWQ1NGUwODU3YzgxYTg0MmQ3OGIxZjM4MTMzMDI2NWQ3MzFhYzA=
13
+ MmU2YTc0NTFkMzE4MzczMWRlNmVjNDc5MWRhYmI0OWRlNDM5ZDRkMzBmMjVm
14
+ NWY3MDk4MzVkMmJmMDQ5ZmJmY2MxNzM0MzY0MGJiMGU5MjY2ZDY3NGNiNTcx
15
+ NjAxOTIxNTRhYTI4NTRjYWQzZjZlMDI2NTIyNDY2OTJjYzFjNTk=
@@ -39,7 +39,7 @@ module RequestTracer
39
39
  end
40
40
 
41
41
  def ==(other_span)
42
- other_span&.value == @value
42
+ other_span && (other_span.value == @value)
43
43
  end
44
44
  def to_s; "%016x" % @value; end
45
45
  def to_i; @i64; end
@@ -129,7 +129,7 @@ module RequestTracer
129
129
  end
130
130
 
131
131
  def record(annotation = nil, &block)
132
- tracer.record(latest&.next_id || create, annotation, &block)
132
+ tracer.record((latest && latest.next_id) || create, annotation, &block)
133
133
  end
134
134
 
135
135
  def tracer=(tracer)
@@ -1,3 +1,3 @@
1
1
  module RequestTracer
2
- VERSION = "0.5.6"
2
+ VERSION = "0.5.8"
3
3
  end
@@ -4,7 +4,7 @@ describe RequestTracer::Trace do
4
4
  let(:trace_stack_size) { rand(2) }
5
5
  let(:trace_stack) do
6
6
  (1..trace_stack_size).inject([]) do |stack, i|
7
- stack + [stack.last&.next_id || described_class.create]
7
+ stack + [(stack.last && stack.last.next_id) || described_class.create]
8
8
  end
9
9
  end
10
10
  before do
@@ -17,7 +17,7 @@ describe RequestTracer::Trace do
17
17
  end
18
18
  it 'generates a new span_id for the scope of the block' do
19
19
  temp_span = record do |t|
20
- expect(t.span_id).not_to eq(trace_stack.last&.span_id)
20
+ expect(t.span_id).not_to eq(trace_stack.last && trace_stack.last.span_id)
21
21
  expect(described_class.latest).to eq(t)
22
22
  t
23
23
  end
@@ -25,10 +25,10 @@ describe RequestTracer::Trace do
25
25
  end
26
26
  it 'takes the old span_id as the parent_span_id' do
27
27
  temp_span = record do |t|
28
- expect(t.parent_id).to eq(trace_stack.last&.span_id)
28
+ expect(t.parent_id).to eq(trace_stack.last && trace_stack.last.span_id)
29
29
  t
30
30
  end
31
- expect(described_class.latest&.span_id).to eq(temp_span.parent_id)
31
+ expect(described_class.latest && described_class.latest.span_id).to eq(temp_span.parent_id)
32
32
  end
33
33
  context 'when no previous trace exists' do
34
34
  let(:trace_stack_size) { 0 }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: request-tracer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Mauch