aws-xray 0.30.0 → 0.30.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: 2b703f29421269426947732cec5a1fe448ea03bd
4
- data.tar.gz: dcdd062b0ff030eddfddd5428d08cdaf6ea9e1d7
3
+ metadata.gz: 9600aaff8b8a437fad42753722c257b732265e80
4
+ data.tar.gz: 2a9987c10c0f5cb51b9666054e93c6787ceea6f3
5
5
  SHA512:
6
- metadata.gz: 42da3f80baf762b6b522c45f39733dbf439aa15ad0955e4e9f720dc80e86e9fa70294a1c02cbc8ab7567543171bf0ba9936de3256b640d8ec542d3d2cf17c6d9
7
- data.tar.gz: 15aef896225eb44eb2f7c57f0300279b8648f2dd491fc8b240b130ec587e1ec9397228de670a9e9ed4568c2f0059ac3e91a54016ca6d2702ef6bfbd2b403d100
6
+ metadata.gz: b0a0a223cd03ba170fd50e844e63907609ead9e2c94026a6804287d3c450ed7c75a800c55f297ee5c03a87b58eccd4eedbcea87fa7561d052b52eae88acf8458
7
+ data.tar.gz: 1d5a6721ce34b053febf4f58976c1de1e78d7e3abf9d8654b13166033a7d37e1598093a06a9f4a654aa281d42dcdf14f590503df4dc3cbe741d0fbe505616308
@@ -13,7 +13,8 @@ module Aws
13
13
  def build_from_header_value(header_value, now = Time.now)
14
14
  h = HeaderParser.parse(header_value)
15
15
  root = h['Root'] || generate_root(now)
16
- new(root: root, sampled: decide_sampling(h['Sampled']), parent: h['Parent'])
16
+ rest = h.dup.tap {|e| %w[Root Sampled Parent].each {|k| e.delete(k) } }
17
+ new(root: root, sampled: decide_sampling(h['Sampled']), parent: h['Parent'], rest: rest)
17
18
  end
18
19
 
19
20
  private
@@ -41,17 +42,15 @@ module Aws
41
42
 
42
43
  attr_reader :root, :parent
43
44
 
44
- def initialize(root:, sampled:, parent: nil)
45
+ def initialize(root:, sampled:, parent: nil, rest: {})
45
46
  @root = root
46
47
  @sampled = sampled
47
48
  @parent = parent
49
+ @rest = rest
48
50
  end
49
51
 
50
52
  def to_header_value
51
- v = "Root=#{@root};"
52
- sampled? ? v << 'Sampled=1' : v << 'Sampled=0'
53
- v << ";Parent=#{@parent}" if has_parent?
54
- v
53
+ to_header_hash.map {|k, v| "#{k}=#{v}" }.join(';')
55
54
  end
56
55
 
57
56
  def sampled?
@@ -65,6 +64,15 @@ module Aws
65
64
  def copy(parent: @parent)
66
65
  self.class.new(root: @root.dup, sampled: @sampled, parent: parent ? parent.dup : nil)
67
66
  end
67
+
68
+ private
69
+
70
+ def to_header_hash
71
+ h = {'Root' => @root, 'Sampled' => sampled? ? '1' : '0' }
72
+ h['Parent'] = @parent if has_parent?
73
+ h.merge!(@rest)
74
+ h
75
+ end
68
76
  end
69
77
  end
70
78
  end
@@ -1,5 +1,5 @@
1
1
  module Aws
2
2
  module Xray
3
- VERSION = '0.30.0'
3
+ VERSION = '0.30.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-xray
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.30.0
4
+ version: 0.30.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taiki Ono