freddy 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 248f2df9adc1e449f26a74a81b3522927490b3a1
4
- data.tar.gz: f5d96272b3eb00f34381d2e1f33544e021f8a96f
3
+ metadata.gz: 7d6c4c4eb4caea3505466f173e26a0126546f318
4
+ data.tar.gz: 3693ce26d92ec11e83affdb10174be3b70459978
5
5
  SHA512:
6
- metadata.gz: aef0dfd64fdc75715a966ee45c3c8dcad85e67d6f5fc57204d419129ced83b50dec1ca40b452255a22cbc132d5ee9a3c7eae773919bbb02901b2d7e9c386b335
7
- data.tar.gz: 6ac1bb9c5e418a79ccda0588a6922c4aab50b44575ab6fde230953c784f138c7533b52ef2b47b6ed339c5f087103a5c8cf9b139637309b6e2bdb8aafb490439d
6
+ metadata.gz: 10f7e439c2d80225c91242602e7647bd79bf658e04583d2fabfd5497f2ac8c67a180b6312e127bceec771b5fc33fba6bbd056d4c591429408ea5adc5aa87c45d
7
+ data.tar.gz: 34ffb7ee253e88cc7cfbbcf831d9e7e342dc64eef70ea85300e620fcf20621867339808cb2915164ff653e007e08df8ae63de3092c974553ea91cbe2a078634c
data/Gemfile CHANGED
@@ -4,6 +4,6 @@ gem 'rspec'
4
4
  gem 'pry'
5
5
  gem 'codeclimate-test-reporter'
6
6
  gem 'hamster', '~> 3.0'
7
- gem 'logasm-tracer', '0.2.0'
7
+ gem 'logasm-tracer', '0.2.2'
8
8
 
9
9
  gemspec
data/freddy.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  else
9
9
  spec.name = "freddy"
10
10
  end
11
- spec.version = '1.3.0'
11
+ spec.version = '1.3.1'
12
12
  spec.authors = ["Salemove TechMovers"]
13
13
  spec.email = ["techmovers@salemove.com"]
14
14
  spec.description = %q{Messaging API}
@@ -24,7 +24,7 @@ class Freddy
24
24
  def build_trace(operation_name, tags: {}, force_follows_from: false)
25
25
  carrier = TraceCarrier.new(@metadata)
26
26
  parent =
27
- if carrier.has_required_fields? && expecting_response? && !force_follows_from
27
+ if expecting_response? && !force_follows_from
28
28
  OpenTracing.global_tracer.extract(OpenTracing::FORMAT_TEXT_MAP, carrier)
29
29
  else
30
30
  nil
@@ -22,9 +22,5 @@ class Freddy
22
22
  .map {|key, value| [key.sub(/x-trace-/, ''), value]}
23
23
  ].each(&block)
24
24
  end
25
-
26
- def has_required_fields?
27
- self['trace-id'] && self['parent-id'] && self['span-id']
28
- end
29
25
  end
30
26
  end
@@ -14,6 +14,7 @@ describe 'Logging with Logasm::Tracer' do
14
14
 
15
15
  before do
16
16
  freddy.respond_to(destination) do |payload, msg_handler|
17
+ sleep 0.1 # emulate some processing
17
18
  msg_handler.success({})
18
19
  end
19
20
  end
@@ -49,6 +50,7 @@ describe 'Logging with Logasm::Tracer' do
49
50
 
50
51
  before do
51
52
  freddy.respond_to(destination) do |payload, msg_handler|
53
+ sleep 0.1 # emulate some processing
52
54
  msg_handler.success({
53
55
  trace_initiator: {},
54
56
  current_receiver: freddy.deliver_with_response(destination2, {})
@@ -56,6 +58,7 @@ describe 'Logging with Logasm::Tracer' do
56
58
  end
57
59
 
58
60
  freddy2.respond_to(destination2) do |payload, msg_handler|
61
+ sleep 0.1 # emulate some processing
59
62
  msg_handler.success({})
60
63
  end
61
64
  end
@@ -8,38 +8,6 @@ describe 'Tracing' do
8
8
  before { OpenTracing.global_tracer = tracer }
9
9
  after { OpenTracing.global_tracer = nil }
10
10
 
11
- context 'when receiving an untraced request' do
12
- let(:freddy) { Freddy.build(logger, config) }
13
- let(:destination) { random_destination }
14
-
15
- before do
16
- freddy.respond_to(destination) do |payload, msg_handler|
17
- msg_handler.success({
18
- trace_id: Freddy.trace.context.trace_id,
19
- parent_id: Freddy.trace.context.parent_id,
20
- span_id: Freddy.trace.context.span_id
21
- })
22
- end
23
- end
24
-
25
- after { freddy.close }
26
-
27
- it 'has generated trace_id' do
28
- response = freddy.deliver_with_response(destination, {})
29
- expect(response.fetch(:trace_id)).to_not be_nil
30
- end
31
-
32
- it 'has no parent_id' do
33
- response = freddy.deliver_with_response(destination, {})
34
- expect(response.fetch(:parent_id)).to be_nil
35
- end
36
-
37
- it 'has generated span_id' do
38
- response = freddy.deliver_with_response(destination, {})
39
- expect(response.fetch(:span_id)).to_not be_nil
40
- end
41
- end
42
-
43
11
  context 'when receiving a traced request' do
44
12
  let(:freddy) { Freddy.build(logger, config) }
45
13
  let(:freddy2) { Freddy.build(logger, config) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: freddy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Salemove TechMovers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-04 00:00:00.000000000 Z
11
+ date: 2017-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler