tchannel 3.6.14 → 3.6.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/as/http.js +2 -2
- package/benchmarks/Makefile +5 -1
- package/benchmarks/index.js +1 -0
- package/benchmarks/multi_bench.js +15 -1
- package/channel.js +18 -5
- package/hyperbahn-client.js +3 -1
- package/lazy_relay.js +167 -24
- package/lib/object_pool.js +209 -0
- package/package.json +4 -4
- package/peer.js +143 -6
- package/peer_heap.js +52 -36
- package/relay_handler.js +4 -1
- package/service-name-handler.js +4 -1
- package/stat-tags.js +24 -1
- package/sub_peers.js +79 -9
- package/test/index.js +2 -0
- package/test/lazy_conn_handler.js +6 -2
- package/test/lazy_handler.js +6 -2
- package/test/lib/alloc-cluster.js +27 -1
- package/test/lib/batch-client.js +17 -2
- package/test/object_pool.js +119 -0
- package/test/peer-to-peer-load-balance.js +459 -0
- package/test/relay_lazy.js +2 -1
- package/test/v2/call.js +1 -0
- package/test/v2/lazy_frame.js +17 -12
- package/v2/args.js +28 -29
- package/v2/call.js +108 -68
- package/v2/checksum.js +2 -2
- package/v2/cont.js +19 -18
- package/v2/error_response.js +6 -8
- package/v2/frame.js +16 -14
- package/v2/handler.js +4 -1
- package/v2/header.js +30 -29
- package/v2/init.js +10 -12
- package/v2/tracing.js +21 -20
package/v2/tracing.js
CHANGED
|
@@ -42,10 +42,11 @@ function Tracing(spanid, parentid, traceid, flags) {
|
|
|
42
42
|
this.flags = flags || 0;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
Tracing.RW = bufrw.Base(tracingByteLength, readTracingFrom, writeTracingInto);
|
|
45
|
+
Tracing.RW = bufrw.Base(tracingByteLength, readTracingFrom, writeTracingInto, true);
|
|
46
46
|
|
|
47
|
-
function tracingByteLength() {
|
|
48
|
-
return
|
|
47
|
+
function tracingByteLength(destResult) {
|
|
48
|
+
return destResult.reset(
|
|
49
|
+
null,
|
|
49
50
|
8 + // spanid:8
|
|
50
51
|
8 + // parentid:8
|
|
51
52
|
8 + // traceid:8
|
|
@@ -53,78 +54,78 @@ function tracingByteLength() {
|
|
|
53
54
|
);
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
function writeTracingInto(tracing, buffer, offset) {
|
|
57
|
+
function writeTracingInto(destResult, tracing, buffer, offset) {
|
|
57
58
|
var res;
|
|
58
59
|
|
|
59
|
-
res = bufrw.UInt32BE.
|
|
60
|
+
res = bufrw.UInt32BE.poolWriteInto(destResult, tracing.spanid[0], buffer, offset);
|
|
60
61
|
if (res.err) return res;
|
|
61
62
|
offset = res.offset;
|
|
62
63
|
|
|
63
|
-
res = bufrw.UInt32BE.
|
|
64
|
+
res = bufrw.UInt32BE.poolWriteInto(destResult, tracing.spanid[1], buffer, offset);
|
|
64
65
|
if (res.err) return res;
|
|
65
66
|
offset = res.offset;
|
|
66
67
|
|
|
67
|
-
res = bufrw.UInt32BE.
|
|
68
|
+
res = bufrw.UInt32BE.poolWriteInto(destResult, tracing.parentid[0], buffer, offset);
|
|
68
69
|
if (res.err) return res;
|
|
69
70
|
offset = res.offset;
|
|
70
71
|
|
|
71
|
-
res = bufrw.UInt32BE.
|
|
72
|
+
res = bufrw.UInt32BE.poolWriteInto(destResult, tracing.parentid[1], buffer, offset);
|
|
72
73
|
if (res.err) return res;
|
|
73
74
|
offset = res.offset;
|
|
74
75
|
|
|
75
|
-
res = bufrw.UInt32BE.
|
|
76
|
+
res = bufrw.UInt32BE.poolWriteInto(destResult, tracing.traceid[0], buffer, offset);
|
|
76
77
|
if (res.err) return res;
|
|
77
78
|
offset = res.offset;
|
|
78
79
|
|
|
79
|
-
res = bufrw.UInt32BE.
|
|
80
|
+
res = bufrw.UInt32BE.poolWriteInto(destResult, tracing.traceid[1], buffer, offset);
|
|
80
81
|
if (res.err) return res;
|
|
81
82
|
offset = res.offset;
|
|
82
83
|
|
|
83
|
-
res = bufrw.UInt8.
|
|
84
|
+
res = bufrw.UInt8.poolWriteInto(destResult, tracing.flags, buffer, offset);
|
|
84
85
|
|
|
85
86
|
return res;
|
|
86
87
|
}
|
|
87
88
|
|
|
88
|
-
function readTracingFrom(buffer, offset) {
|
|
89
|
+
function readTracingFrom(destResult, buffer, offset) {
|
|
89
90
|
var tracing = new Tracing();
|
|
90
91
|
var res;
|
|
91
92
|
|
|
92
|
-
res = bufrw.UInt32BE.
|
|
93
|
+
res = bufrw.UInt32BE.poolReadFrom(destResult, buffer, offset);
|
|
93
94
|
if (res.err) return res;
|
|
94
95
|
offset = res.offset;
|
|
95
96
|
tracing.spanid[0] = res.value;
|
|
96
97
|
|
|
97
|
-
res = bufrw.UInt32BE.
|
|
98
|
+
res = bufrw.UInt32BE.poolReadFrom(destResult, buffer, offset);
|
|
98
99
|
if (res.err) return res;
|
|
99
100
|
offset = res.offset;
|
|
100
101
|
tracing.spanid[1] = res.value;
|
|
101
102
|
|
|
102
|
-
res = bufrw.UInt32BE.
|
|
103
|
+
res = bufrw.UInt32BE.poolReadFrom(destResult, buffer, offset);
|
|
103
104
|
if (res.err) return res;
|
|
104
105
|
offset = res.offset;
|
|
105
106
|
tracing.parentid[0] = res.value;
|
|
106
107
|
|
|
107
|
-
res = bufrw.UInt32BE.
|
|
108
|
+
res = bufrw.UInt32BE.poolReadFrom(destResult, buffer, offset);
|
|
108
109
|
if (res.err) return res;
|
|
109
110
|
offset = res.offset;
|
|
110
111
|
tracing.parentid[1] = res.value;
|
|
111
112
|
|
|
112
|
-
res = bufrw.UInt32BE.
|
|
113
|
+
res = bufrw.UInt32BE.poolReadFrom(destResult, buffer, offset);
|
|
113
114
|
if (res.err) return res;
|
|
114
115
|
offset = res.offset;
|
|
115
116
|
tracing.traceid[0] = res.value;
|
|
116
117
|
|
|
117
|
-
res = bufrw.UInt32BE.
|
|
118
|
+
res = bufrw.UInt32BE.poolReadFrom(destResult, buffer, offset);
|
|
118
119
|
if (res.err) return res;
|
|
119
120
|
offset = res.offset;
|
|
120
121
|
tracing.traceid[1] = res.value;
|
|
121
122
|
|
|
122
|
-
res = bufrw.UInt8.
|
|
123
|
+
res = bufrw.UInt8.poolReadFrom(destResult, buffer, offset);
|
|
123
124
|
if (res.err) return res;
|
|
124
125
|
offset = res.offset;
|
|
125
126
|
tracing.flags = res.value;
|
|
126
127
|
|
|
127
|
-
return
|
|
128
|
+
return destResult.reset(null, offset, tracing);
|
|
128
129
|
}
|
|
129
130
|
|
|
130
131
|
Tracing.emptyTracing = new Tracing();
|