aws-xray 0.12.1 → 0.12.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws/xray/client.rb +5 -2
- data/lib/aws/xray/context.rb +4 -3
- data/lib/aws/xray/trace.rb +4 -5
- data/lib/aws/xray/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 263047b7e176ea3323645433bb42f1a04d451d17
|
4
|
+
data.tar.gz: 2361cf717b1e846fb4fda1b68c1bbf1da3f60b6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a483a0f714c25c101227822512aecd2810f08f02676ed2883eb82b7044564aa9fb1e1a99394e9aaa02495e821f1173b7cd88a4f4eca332b5655a20762fab6d3
|
7
|
+
data.tar.gz: bc827a4ec3c100a2798655152886454e5b4dc9c350be088e51a96ec2f85a50da1f8fd7f3795c782f2a3430ae64baf6efad9ed1ced52fd2139ad196291109ee20
|
data/lib/aws/xray/client.rb
CHANGED
@@ -7,9 +7,12 @@ module Aws
|
|
7
7
|
class Client
|
8
8
|
# sock is for test.
|
9
9
|
def initialize(host: nil, port: nil, sock: nil)
|
10
|
-
@host, @port = host
|
10
|
+
@host, @port = host, port
|
11
11
|
@sock = sock
|
12
|
-
|
12
|
+
end
|
13
|
+
|
14
|
+
def copy
|
15
|
+
self.class.new(host: @host ? @host.dup : nil, port: @port, sock: @sock)
|
13
16
|
end
|
14
17
|
|
15
18
|
# When UDPSocket#send can not send all bytes, just give up it.
|
data/lib/aws/xray/context.rb
CHANGED
@@ -63,7 +63,8 @@ module Aws
|
|
63
63
|
|
64
64
|
# client and trace are frozen by default.
|
65
65
|
def initialize(name, client, trace, base_segment_id = nil)
|
66
|
-
|
66
|
+
raise 'name is required' unless name
|
67
|
+
@name = name
|
67
68
|
@client = client
|
68
69
|
@trace = trace
|
69
70
|
@base_segment_id = base_segment_id
|
@@ -77,7 +78,7 @@ module Aws
|
|
77
78
|
#
|
78
79
|
# See README for example.
|
79
80
|
def copy
|
80
|
-
self.class.new(@name, @client, @trace, @base_segment_id)
|
81
|
+
self.class.new(@name.dup, @client.copy, @trace.copy, @base_segment_id ? @base_segment_id.dup : nil)
|
81
82
|
end
|
82
83
|
|
83
84
|
# Rescue standard errors and record the error to the segment.
|
@@ -87,7 +88,7 @@ module Aws
|
|
87
88
|
# @return [Object] A value which given block returns.
|
88
89
|
def base_trace
|
89
90
|
base_segment = Segment.build(@name, @trace)
|
90
|
-
@base_segment_id = base_segment.id
|
91
|
+
@base_segment_id = base_segment.id
|
91
92
|
|
92
93
|
begin
|
93
94
|
yield base_segment
|
data/lib/aws/xray/trace.rb
CHANGED
@@ -26,10 +26,9 @@ module Aws
|
|
26
26
|
attr_reader :root, :parent
|
27
27
|
|
28
28
|
def initialize(root:, sampled: true, parent: nil)
|
29
|
-
@root = root
|
29
|
+
@root = root
|
30
30
|
@sampled = sampled
|
31
|
-
@parent = parent
|
32
|
-
freeze
|
31
|
+
@parent = parent
|
33
32
|
end
|
34
33
|
|
35
34
|
def to_header_value
|
@@ -47,8 +46,8 @@ module Aws
|
|
47
46
|
!!@parent
|
48
47
|
end
|
49
48
|
|
50
|
-
def copy(parent:)
|
51
|
-
self.class.new(root: @root.dup, sampled: @sampled, parent: parent.
|
49
|
+
def copy(parent: @parent)
|
50
|
+
self.class.new(root: @root.dup, sampled: @sampled, parent: parent ? parent.dup : nil)
|
52
51
|
end
|
53
52
|
end
|
54
53
|
end
|
data/lib/aws/xray/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-xray
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taiki Ono
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|