whatap 0.4.79 → 0.4.81
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/.vscode/keep-context.json +3 -3
- package/README.md +51 -51
- package/bindings/darwin/x64/whatap.node +0 -0
- package/bindings/linux/ia32/whatap.node +0 -0
- package/bindings/linux/x64/whatap.node +0 -0
- package/help.txt +10 -10
- package/index.js +8 -8
- package/lib/conf/conf-sys-mon.js +100 -100
- package/lib/conf/config-default.js +238 -238
- package/lib/conf/configure.js +423 -423
- package/lib/conf/license.js +41 -41
- package/lib/control/cmd-config.js +23 -23
- package/lib/control/control-handler.js +344 -344
- package/lib/control/packagectr-helper.js +149 -149
- package/lib/core/agent.js +329 -328
- package/lib/core/interceptor.js +142 -142
- package/lib/core/request-agent.js +26 -26
- package/lib/counter/counter-manager.js +127 -127
- package/lib/counter/meter/meter-activex.js +66 -66
- package/lib/counter/meter/meter-httpc.js +57 -57
- package/lib/counter/meter/meter-resource.js +9 -9
- package/lib/counter/meter/meter-service.js +167 -167
- package/lib/counter/meter/meter-socket.io.js +50 -50
- package/lib/counter/meter/meter-sql.js +70 -70
- package/lib/counter/meter/meter-users.js +57 -57
- package/lib/counter/meter.js +183 -183
- package/lib/counter/task/activetransaction.js +93 -93
- package/lib/counter/task/agentinfo.js +105 -105
- package/lib/counter/task/counter-task.js +9 -9
- package/lib/counter/task/gcstat.js +34 -34
- package/lib/counter/task/heapmem.js +24 -24
- package/lib/counter/task/httpc.js +75 -75
- package/lib/counter/task/proc-cpu.js +28 -28
- package/lib/counter/task/realtimeuser.js +30 -30
- package/lib/counter/task/res/systemECSTask.js +54 -54
- package/lib/counter/task/res/systemKubeTask.js +52 -52
- package/lib/counter/task/res/util/awsEcsClientThread.js +166 -166
- package/lib/counter/task/res/util/linuxProcStatUtil.js +13 -13
- package/lib/counter/task/res-sys-cpu.js +61 -61
- package/lib/counter/task/service.js +201 -201
- package/lib/counter/task/socketio.js +29 -29
- package/lib/counter/task/sql.js +104 -104
- package/lib/counter/task/systemperf.js +42 -42
- package/lib/data/datapack-sender.js +256 -256
- package/lib/data/dataprofile-agent.js +136 -136
- package/lib/data/datatext-agent.js +135 -135
- package/lib/data/event-level.js +15 -15
- package/lib/data/test.js +48 -48
- package/lib/env/constants.js +20 -20
- package/lib/kube/kube-client.js +143 -143
- package/lib/lang/text-types.js +58 -58
- package/lib/logger.js +319 -319
- package/lib/net/netflag.js +54 -54
- package/lib/net/paramdef.js +40 -40
- package/lib/net/receiver.js +65 -65
- package/lib/net/security-master.js +182 -173
- package/lib/net/sender.js +140 -140
- package/lib/net/tcp-return.js +17 -17
- package/lib/net/tcp-session.js +285 -285
- package/lib/net/tcpreq-client-proxy.js +69 -69
- package/lib/net/tcprequest-mgr.js +57 -57
- package/lib/observers/cluster-observer.js +21 -21
- package/lib/observers/express-observer.js +214 -214
- package/lib/observers/file-observer.js +184 -184
- package/lib/observers/global-observer.js +30 -30
- package/lib/observers/http-observer.js +714 -704
- package/lib/observers/maria-observer.js +382 -382
- package/lib/observers/memcached-observer.js +55 -55
- package/lib/observers/mongo-observer.js +262 -265
- package/lib/observers/mongodb-observer.js +197 -197
- package/lib/observers/mongoose-observer.js +83 -83
- package/lib/observers/mssql-observer.js +205 -205
- package/lib/observers/mysql-observer.js +436 -394
- package/lib/observers/net-observer.js +72 -72
- package/lib/observers/pgsql-observer.js +295 -295
- package/lib/observers/process-observer.js +25 -25
- package/lib/observers/promise-observer.js +31 -31
- package/lib/observers/redis-observer.js +156 -109
- package/lib/observers/schedule-observer.js +66 -66
- package/lib/observers/socket.io-observer.js +54 -54
- package/lib/observers/stream-observer.js +19 -19
- package/lib/observers/thrift-observer.js +196 -196
- package/lib/pack/activestack-pack.js +54 -54
- package/lib/pack/counter-pack.js +649 -649
- package/lib/pack/errorsnap-pack.js +68 -68
- package/lib/pack/event-pack.js +53 -53
- package/lib/pack/hitmap-pack.js +62 -62
- package/lib/pack/hitmap-pack1.js +146 -146
- package/lib/pack/netstat.js +14 -14
- package/lib/pack/pack.js +49 -49
- package/lib/pack/packenum.js +60 -60
- package/lib/pack/param-pack.js +213 -213
- package/lib/pack/profile-pack.js +48 -48
- package/lib/pack/realtimeuser-pack.js +40 -40
- package/lib/pack/stat-general-pack.js +95 -95
- package/lib/pack/staterror-pack.js +119 -119
- package/lib/pack/stathttpc-pack.js +66 -66
- package/lib/pack/stathttpc-rec.js +78 -78
- package/lib/pack/statremote-pack.js +45 -45
- package/lib/pack/statservice-pack.js +62 -62
- package/lib/pack/statservice-pack1.js +87 -87
- package/lib/pack/statservice-rec.js +292 -292
- package/lib/pack/statservice-rec_dep.js +151 -151
- package/lib/pack/statsql-pack.js +69 -69
- package/lib/pack/statsql-rec.js +100 -100
- package/lib/pack/statuseragent-pack.js +43 -43
- package/lib/pack/tagcount-pack.js +398 -398
- package/lib/pack/tagctr.js +14 -14
- package/lib/pack/text-pack.js +49 -49
- package/lib/pack/time-count.js +25 -25
- package/lib/pack/websocket.js +14 -14
- package/lib/plugin/plugin-loadermanager.js +56 -56
- package/lib/plugin/plugin.js +75 -75
- package/lib/requestlog.js +326 -326
- package/lib/service/tx-record.js +293 -288
- package/lib/stat/stat-error.js +116 -116
- package/lib/stat/stat-httpc.js +97 -97
- package/lib/stat/stat-remoteip.js +46 -46
- package/lib/stat/stat-sql.js +112 -112
- package/lib/stat/stat-tranx.js +57 -57
- package/lib/stat/stat-tx-caller.js +159 -159
- package/lib/stat/stat-tx-domain.js +110 -110
- package/lib/stat/stat-tx-referer.js +111 -111
- package/lib/stat/stat-useragent.js +48 -48
- package/lib/stat/timingsender.js +72 -72
- package/lib/step/activestack-step.js +37 -37
- package/lib/step/dbc-step.js +35 -35
- package/lib/step/http-stepx.js +66 -66
- package/lib/step/message-step.js +39 -39
- package/lib/step/method-stepx.js +46 -46
- package/lib/step/resultset-step.js +39 -39
- package/lib/step/securemsg-step.js +43 -43
- package/lib/step/socket-step.js +46 -46
- package/lib/step/sql-stepx.js +67 -67
- package/lib/step/sqlxtype.js +15 -15
- package/lib/step/step.js +65 -65
- package/lib/step/stepenum.js +53 -53
- package/lib/trace/local-context.js +13 -13
- package/lib/trace/parsed-sql.js +13 -13
- package/lib/trace/profile-collector.js +70 -70
- package/lib/trace/serviceurl-pattern-detector.js +117 -117
- package/lib/trace/trace-context-manager.js +195 -195
- package/lib/trace/trace-context.js +136 -134
- package/lib/util/anylist.js +102 -102
- package/lib/util/array-util.js +100 -100
- package/lib/util/bitutil.js +27 -27
- package/lib/util/cardinality/hyperloglog.js +105 -105
- package/lib/util/cardinality/murmurhash.js +31 -31
- package/lib/util/cardinality/registerset.js +74 -74
- package/lib/util/config-util.js +17 -17
- package/lib/util/cypher.js +89 -89
- package/lib/util/datetimehelper.js +237 -229
- package/lib/util/dateutil.js +110 -106
- package/lib/util/errordata.js +20 -20
- package/lib/util/escape-literal-sql.js +342 -342
- package/lib/util/hashutil2.js +126 -126
- package/lib/util/hexa32.js +57 -57
- package/lib/util/index.js +78 -78
- package/lib/util/intint-map.js +47 -47
- package/lib/util/intkey-linkedmap.js +26 -26
- package/lib/util/intkey-map.js +25 -25
- package/lib/util/intset.js +82 -82
- package/lib/util/iputil.js +119 -119
- package/lib/util/iputil_x.js +526 -526
- package/lib/util/keygen.js +17 -17
- package/lib/util/kube-util.js +72 -72
- package/lib/util/longint-linkedmap.js +35 -35
- package/lib/util/longkey-linkedmap.js +25 -25
- package/lib/util/longlong-linkedmap.js +37 -37
- package/lib/util/nodeutil.js +67 -67
- package/lib/util/oidutil.js +96 -93
- package/lib/util/paramsecurity.js +78 -78
- package/lib/util/pathtree.js +172 -172
- package/lib/util/pre-process.js +13 -13
- package/lib/util/process-seq.js +165 -165
- package/lib/util/property-util.js +35 -35
- package/lib/util/request-queue.js +42 -42
- package/lib/util/requestdouble-queue.js +72 -72
- package/lib/util/resourceprofile.js +156 -156
- package/lib/util/seedrandom.js +242 -242
- package/lib/util/stop-watch.js +29 -29
- package/lib/util/string-util.js +9 -9
- package/lib/util/stringkey-linkedmap.js +28 -28
- package/lib/util/stringnum-linkedmap.js +31 -31
- package/lib/util/stringset.js +65 -65
- package/lib/util/system-util.js +9 -9
- package/lib/util/userid-util.js +57 -57
- package/lib/util/utils.js +67 -67
- package/lib/value/blob-value.js +61 -61
- package/lib/value/boolean-value.js +51 -51
- package/lib/value/decimal-value.js +71 -71
- package/lib/value/double-summary.js +105 -105
- package/lib/value/double-value.js +50 -50
- package/lib/value/float-array.js +59 -59
- package/lib/value/float-value.js +64 -64
- package/lib/value/int-array.js +59 -59
- package/lib/value/int-map-value.js +151 -151
- package/lib/value/int-value.js +64 -64
- package/lib/value/ip4-value.js +83 -83
- package/lib/value/list-value.js +136 -136
- package/lib/value/long-array.js +59 -59
- package/lib/value/long-summary.js +105 -105
- package/lib/value/map-value.js +175 -175
- package/lib/value/metric-value.js +157 -157
- package/lib/value/null-value.js +42 -42
- package/lib/value/number-value.js +34 -34
- package/lib/value/summary-value.js +29 -29
- package/lib/value/text-array.js +117 -117
- package/lib/value/text-value.js +59 -59
- package/lib/value/texthash-value.js +49 -49
- package/lib/value/value.js +14 -14
- package/lib/value/valueenum.js +99 -99
- package/logs/whatap-20230906.log +54 -0
- package/logs/whatap-20231101.log +293 -0
- package/package.json +28 -28
- package/whatap.conf +1 -1
- package/logs/whatap-20230616.log +0 -13
package/lib/service/tx-record.js
CHANGED
|
@@ -1,289 +1,294 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2016 the WHATAP project authors. All rights reserved.
|
|
3
|
-
* Use of this source code is governed by a license that
|
|
4
|
-
* can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
var DataOutputX = require('../io/data-outputx'),
|
|
8
|
-
DataInputX = require('../io/data-inputx'),
|
|
9
|
-
Long = require('long') ,
|
|
10
|
-
EventLevel = require('../data/event-level');
|
|
11
|
-
function TxRecord() {
|
|
12
|
-
this.seq = Long.ZERO;
|
|
13
|
-
this.endTime =0;
|
|
14
|
-
this.service = 0;
|
|
15
|
-
this.elapsed = 0;
|
|
16
|
-
this.error = Long.ZERO;
|
|
17
|
-
this.cpuTime = 0;
|
|
18
|
-
this.malloc = 0;
|
|
19
|
-
|
|
20
|
-
this.sqlCount = 0;
|
|
21
|
-
this.sqlTime = 0;
|
|
22
|
-
this.sqlFetchCount = 0;
|
|
23
|
-
this.sqlFetchTime = 0;
|
|
24
|
-
|
|
25
|
-
this.httpcCount = 0;
|
|
26
|
-
this.httpcTime = 0;
|
|
27
|
-
this.active = false;
|
|
28
|
-
this.steps_data_pos = 0;
|
|
29
|
-
this.cipher = 0;
|
|
30
|
-
|
|
31
|
-
this.ipaddr = 0;
|
|
32
|
-
this.userid = Long.ZERO;
|
|
33
|
-
this.userAgent = 0;
|
|
34
|
-
this.referer = 0;
|
|
35
|
-
this.status = 0;
|
|
36
|
-
|
|
37
|
-
this.mtid = Long.ZERO;
|
|
38
|
-
this.mdepth = 0;
|
|
39
|
-
this.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
this.
|
|
43
|
-
this.
|
|
44
|
-
this.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
this.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
this.
|
|
62
|
-
this.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
o
|
|
74
|
-
o.
|
|
75
|
-
o.writeDecimal(this.
|
|
76
|
-
o.writeDecimal(this.
|
|
77
|
-
o.writeDecimal(this.
|
|
78
|
-
|
|
79
|
-
o.writeDecimal(this.
|
|
80
|
-
o.writeDecimal(this.
|
|
81
|
-
|
|
82
|
-
o.writeDecimal(this.
|
|
83
|
-
|
|
84
|
-
o.writeDecimal(this.
|
|
85
|
-
o.writeDecimal(this.
|
|
86
|
-
|
|
87
|
-
o.
|
|
88
|
-
o.writeDecimal(this.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
o.
|
|
92
|
-
o.writeDecimal(this.
|
|
93
|
-
|
|
94
|
-
o.
|
|
95
|
-
o.writeDecimal(this.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
o.
|
|
102
|
-
|
|
103
|
-
o.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
o.writeByte(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
o.
|
|
110
|
-
o.writeDecimal(this.
|
|
111
|
-
o.writeDecimal(this.
|
|
112
|
-
o.writeDecimal(this.
|
|
113
|
-
|
|
114
|
-
o.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
o.writeByte(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
o.
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
o.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
o.
|
|
147
|
-
|
|
148
|
-
////////////// BLOB ///////////////
|
|
149
|
-
dout.writeBlob(o.toByteArray());
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
TxRecord.prototype.read = function(din) {
|
|
153
|
-
var ver = din.readByte();
|
|
154
|
-
if(ver <10){
|
|
155
|
-
throw new Error('TxRecord has invalid version='+ver);
|
|
156
|
-
}
|
|
157
|
-
var i = new DataInputX(din.readBlob());
|
|
158
|
-
this.seq = i.readLong();
|
|
159
|
-
this.endTime = i.readDecNumber();
|
|
160
|
-
this.service = i.readDecNumber();
|
|
161
|
-
this.elapsed = i.readDecNumber();
|
|
162
|
-
this.error = i.readDecimal();
|
|
163
|
-
|
|
164
|
-
this.cpuTime = i.readDecNumber();
|
|
165
|
-
this.malloc = i.readDecNumber();
|
|
166
|
-
|
|
167
|
-
this.sqlCount = i.readDecNumber();
|
|
168
|
-
this.sqlTime = i.readDecNumber();
|
|
169
|
-
this.sqlFetchCount = i.readDecNumber();
|
|
170
|
-
this.sqlFetchTime = i.readDecNumber();
|
|
171
|
-
|
|
172
|
-
this.httpcCount = i.readDecNumber();
|
|
173
|
-
this.httpcTime = i.readDecNumber();
|
|
174
|
-
|
|
175
|
-
this.active = i.readBoolean();
|
|
176
|
-
this.steps_data_pos = i.readDecNumber();
|
|
177
|
-
this.cipher = i.readDecNumber();
|
|
178
|
-
|
|
179
|
-
this.ipaddr = i.readInt();
|
|
180
|
-
this.userid = i.readDecLong();
|
|
181
|
-
this.userAgent = i.readDecNumber();
|
|
182
|
-
this.referer = i.readDecNumber();
|
|
183
|
-
this.status = i.readDecNumber();
|
|
184
|
-
|
|
185
|
-
if(i.readByte() >0){
|
|
186
|
-
this.mtid = i.readDecLong();
|
|
187
|
-
this.mdepth = i.readDecNumber();
|
|
188
|
-
this.mcaller_txid = i.readDecLong();
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
switch (i.readByte()) {
|
|
192
|
-
case 1:
|
|
193
|
-
this.mcaller_pcode = i.readDecNumber();
|
|
194
|
-
break;
|
|
195
|
-
case 3:
|
|
196
|
-
this.mcaller_pcode = i.readDecNumber();
|
|
197
|
-
this.mcaller_spec = i.readDecNumber();
|
|
198
|
-
this.mcaller_url = i.readDecNumber();
|
|
199
|
-
break;
|
|
200
|
-
case 4:
|
|
201
|
-
this.mcaller_pcode = i.readDecNumber();
|
|
202
|
-
this.mcaller_spec = i.readDecNumber();
|
|
203
|
-
this.mcaller_url = i.readDecNumber();
|
|
204
|
-
this.mthis_spec = i.readDecNumber();
|
|
205
|
-
break;
|
|
206
|
-
case 5:
|
|
207
|
-
this.mcaller_pcode = i.readDecNumber();
|
|
208
|
-
this.mcaller_oid = i.readDecNumber();
|
|
209
|
-
this.mcaller_spec = i.readDecNumber();
|
|
210
|
-
this.mcaller_url = i.readDecNumber();
|
|
211
|
-
this.mthis_spec = i.readDecNumber();
|
|
212
|
-
break;
|
|
213
|
-
case 6:
|
|
214
|
-
this.mcaller_pcode = i.readDecNumber();
|
|
215
|
-
this.mcaller_okind = i.readDecNumber();
|
|
216
|
-
this.mcaller_oid = i.readDecNumber();
|
|
217
|
-
this.mcaller_spec = i.readDecNumber();
|
|
218
|
-
this.mcaller_url = i.readDecNumber();
|
|
219
|
-
this.mthis_spec = i.readDecNumber();
|
|
220
|
-
break;
|
|
221
|
-
}
|
|
222
|
-
this.http_method = i.readByte();
|
|
223
|
-
this.domain = i.readDecNumber();
|
|
224
|
-
|
|
225
|
-
var n = i.readByte();
|
|
226
|
-
if (n > 0) {
|
|
227
|
-
this.fields = new Array(n);
|
|
228
|
-
for (var c = 0; c < n; c++) {
|
|
229
|
-
var id = i.readByte();
|
|
230
|
-
var value = i.readText();
|
|
231
|
-
this.fields[i] = {
|
|
232
|
-
id: id,
|
|
233
|
-
value: value
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
if (i.available() > 0) {
|
|
239
|
-
this.login = i.readDecNumber();
|
|
240
|
-
}
|
|
241
|
-
if (i.available() > 0) {
|
|
242
|
-
this.errorLevel = i.readByte();
|
|
243
|
-
} else {
|
|
244
|
-
if (this.error != 0) {
|
|
245
|
-
this.errorLevel = EventLevel.WARNING;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
if(i.available()>0) {
|
|
249
|
-
this.oid = i.readDecNumber();
|
|
250
|
-
this.okind = i.readDecNumber();
|
|
251
|
-
this.onode = i.readDecNumber();
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
if (i.available() > 0) {
|
|
255
|
-
this.custid = i.readText();
|
|
256
|
-
}
|
|
257
|
-
if (i.available() > 0) {
|
|
258
|
-
this.dbcTime = i.readDecNumber();
|
|
259
|
-
}
|
|
260
|
-
if (i.available() > 0) {
|
|
261
|
-
this.apdex = i.readByte();
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
this
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
TxRecord.
|
|
285
|
-
TxRecord.
|
|
286
|
-
TxRecord.
|
|
287
|
-
TxRecord.
|
|
288
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2016 the WHATAP project authors. All rights reserved.
|
|
3
|
+
* Use of this source code is governed by a license that
|
|
4
|
+
* can be found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
var DataOutputX = require('../io/data-outputx'),
|
|
8
|
+
DataInputX = require('../io/data-inputx'),
|
|
9
|
+
Long = require('long') ,
|
|
10
|
+
EventLevel = require('../data/event-level');
|
|
11
|
+
function TxRecord() {
|
|
12
|
+
this.seq = Long.ZERO;
|
|
13
|
+
this.endTime =0;
|
|
14
|
+
this.service = 0;
|
|
15
|
+
this.elapsed = 0;
|
|
16
|
+
this.error = Long.ZERO;
|
|
17
|
+
this.cpuTime = 0;
|
|
18
|
+
this.malloc = 0;
|
|
19
|
+
|
|
20
|
+
this.sqlCount = 0;
|
|
21
|
+
this.sqlTime = 0;
|
|
22
|
+
this.sqlFetchCount = 0;
|
|
23
|
+
this.sqlFetchTime = 0;
|
|
24
|
+
|
|
25
|
+
this.httpcCount = 0;
|
|
26
|
+
this.httpcTime = 0;
|
|
27
|
+
this.active = false;
|
|
28
|
+
this.steps_data_pos = 0;
|
|
29
|
+
this.cipher = 0;
|
|
30
|
+
|
|
31
|
+
this.ipaddr = 0;
|
|
32
|
+
this.userid = Long.ZERO;
|
|
33
|
+
this.userAgent = 0;
|
|
34
|
+
this.referer = 0;
|
|
35
|
+
this.status = 0;
|
|
36
|
+
|
|
37
|
+
this.mtid = Long.ZERO;
|
|
38
|
+
this.mdepth = 0;
|
|
39
|
+
this.mcaller = Long.ZERO;
|
|
40
|
+
this.mcaller_txid = Long.ZERO;
|
|
41
|
+
|
|
42
|
+
this.mcaller_pcode = 0;
|
|
43
|
+
this.mcaller_okind = 0;
|
|
44
|
+
this.mcaller_oid = 0;
|
|
45
|
+
this.mcaller_spec = 0;
|
|
46
|
+
this.mcaller_url = 0;
|
|
47
|
+
this.mthis_spec = 0;
|
|
48
|
+
|
|
49
|
+
this.http_method = 0;
|
|
50
|
+
|
|
51
|
+
this.domain = 0;
|
|
52
|
+
this.fields = [];
|
|
53
|
+
|
|
54
|
+
this.login=0;
|
|
55
|
+
this.errorLevel=0;
|
|
56
|
+
|
|
57
|
+
this.oid=0;
|
|
58
|
+
this.okind=0;
|
|
59
|
+
this.onode=0;
|
|
60
|
+
|
|
61
|
+
this.custid=null;
|
|
62
|
+
this.dbcTime=0;
|
|
63
|
+
this.apdex=0;
|
|
64
|
+
|
|
65
|
+
this.mcallerStepId = Long.ZERO;
|
|
66
|
+
this.originUrl = null;
|
|
67
|
+
}
|
|
68
|
+
TxRecord.prototype.getServiceType = function() {return 0;};
|
|
69
|
+
|
|
70
|
+
TxRecord.prototype.write = function(dout) {
|
|
71
|
+
dout.writeByte(10); //version
|
|
72
|
+
|
|
73
|
+
var o = new DataOutputX();
|
|
74
|
+
o.writeLong(this.seq);
|
|
75
|
+
o.writeDecimal(this.endTime);
|
|
76
|
+
o.writeDecimal(this.service);
|
|
77
|
+
o.writeDecimal(this.elapsed);
|
|
78
|
+
o.writeDecimal(this.error);
|
|
79
|
+
o.writeDecimal(this.cpuTime);
|
|
80
|
+
o.writeDecimal(this.malloc);
|
|
81
|
+
|
|
82
|
+
o.writeDecimal(this.sqlCount);
|
|
83
|
+
o.writeDecimal(this.sqlTime);
|
|
84
|
+
o.writeDecimal(this.sqlFetchCount);
|
|
85
|
+
o.writeDecimal(this.sqlFetchTime);
|
|
86
|
+
|
|
87
|
+
o.writeDecimal(this.httpcCount);
|
|
88
|
+
o.writeDecimal(this.httpcTime);
|
|
89
|
+
|
|
90
|
+
o.writeBoolean(this.active);
|
|
91
|
+
o.writeDecimal(this.steps_data_pos);
|
|
92
|
+
o.writeDecimal(this.cipher);
|
|
93
|
+
|
|
94
|
+
o.writeInt(this.ipaddr);
|
|
95
|
+
o.writeDecimal(this.userid);
|
|
96
|
+
o.writeDecimal(this.userAgent);
|
|
97
|
+
o.writeDecimal(this.referer);
|
|
98
|
+
o.writeDecimal(this.status);
|
|
99
|
+
|
|
100
|
+
if(this.mtid.isZero()==false){
|
|
101
|
+
o.writeByte(1);
|
|
102
|
+
o.writeDecimal(this.mtid);
|
|
103
|
+
o.writeDecimal(this.mdepth);
|
|
104
|
+
o.writeDecimal(this.mcaller);
|
|
105
|
+
}else{
|
|
106
|
+
o.writeByte(0);
|
|
107
|
+
}
|
|
108
|
+
if(this.mcaller_pcode!=0) {
|
|
109
|
+
o.writeByte(6);
|
|
110
|
+
o.writeDecimal(this.mcaller_pcode);
|
|
111
|
+
o.writeDecimal(this.mcaller_okind);
|
|
112
|
+
o.writeDecimal(this.mcaller_oid);
|
|
113
|
+
o.writeDecimal(this.mcaller_spec);
|
|
114
|
+
o.writeDecimal(this.mcaller_url);
|
|
115
|
+
o.writeDecimal(this.mthis_spec);//보통 0, 서버에서 셋팅
|
|
116
|
+
}else {
|
|
117
|
+
o.writeByte(0);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
o.writeByte(this.http_method);
|
|
121
|
+
o.writeDecimal(this.domain);
|
|
122
|
+
|
|
123
|
+
if (this.fields == null || this.fields.length==0) {
|
|
124
|
+
o.writeByte(0);
|
|
125
|
+
} else {
|
|
126
|
+
var sz = this.fields.length;
|
|
127
|
+
o.writeByte(sz);
|
|
128
|
+
for (var i = 0; i < sz; i++) {
|
|
129
|
+
o.writeByte(this.fields[i].id);
|
|
130
|
+
o.writeText(this.fields[i].value);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
o.writeDecimal(this.login);
|
|
134
|
+
o.writeByte(this.errorLevel);
|
|
135
|
+
|
|
136
|
+
// 2018.12.28
|
|
137
|
+
o.writeDecimal(this.oid);
|
|
138
|
+
o.writeDecimal(this.okind);
|
|
139
|
+
o.writeDecimal(this.onode);
|
|
140
|
+
|
|
141
|
+
o.writeText(this.custid);
|
|
142
|
+
o.writeDecimal(this.dbcTime);
|
|
143
|
+
o.writeByte(this.apdex);
|
|
144
|
+
|
|
145
|
+
o.writeDecimal(this.mcallerStepId);
|
|
146
|
+
o.writeText(this.originUrl);
|
|
147
|
+
|
|
148
|
+
////////////// BLOB ///////////////
|
|
149
|
+
dout.writeBlob(o.toByteArray());
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
TxRecord.prototype.read = function(din) {
|
|
153
|
+
var ver = din.readByte();
|
|
154
|
+
if(ver <10){
|
|
155
|
+
throw new Error('TxRecord has invalid version='+ver);
|
|
156
|
+
}
|
|
157
|
+
var i = new DataInputX(din.readBlob());
|
|
158
|
+
this.seq = i.readLong();
|
|
159
|
+
this.endTime = i.readDecNumber();
|
|
160
|
+
this.service = i.readDecNumber();
|
|
161
|
+
this.elapsed = i.readDecNumber();
|
|
162
|
+
this.error = i.readDecimal();
|
|
163
|
+
|
|
164
|
+
this.cpuTime = i.readDecNumber();
|
|
165
|
+
this.malloc = i.readDecNumber();
|
|
166
|
+
|
|
167
|
+
this.sqlCount = i.readDecNumber();
|
|
168
|
+
this.sqlTime = i.readDecNumber();
|
|
169
|
+
this.sqlFetchCount = i.readDecNumber();
|
|
170
|
+
this.sqlFetchTime = i.readDecNumber();
|
|
171
|
+
|
|
172
|
+
this.httpcCount = i.readDecNumber();
|
|
173
|
+
this.httpcTime = i.readDecNumber();
|
|
174
|
+
|
|
175
|
+
this.active = i.readBoolean();
|
|
176
|
+
this.steps_data_pos = i.readDecNumber();
|
|
177
|
+
this.cipher = i.readDecNumber();
|
|
178
|
+
|
|
179
|
+
this.ipaddr = i.readInt();
|
|
180
|
+
this.userid = i.readDecLong();
|
|
181
|
+
this.userAgent = i.readDecNumber();
|
|
182
|
+
this.referer = i.readDecNumber();
|
|
183
|
+
this.status = i.readDecNumber();
|
|
184
|
+
|
|
185
|
+
if(i.readByte() >0){
|
|
186
|
+
this.mtid = i.readDecLong();
|
|
187
|
+
this.mdepth = i.readDecNumber();
|
|
188
|
+
this.mcaller_txid = i.readDecLong();
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
switch (i.readByte()) {
|
|
192
|
+
case 1:
|
|
193
|
+
this.mcaller_pcode = i.readDecNumber();
|
|
194
|
+
break;
|
|
195
|
+
case 3:
|
|
196
|
+
this.mcaller_pcode = i.readDecNumber();
|
|
197
|
+
this.mcaller_spec = i.readDecNumber();
|
|
198
|
+
this.mcaller_url = i.readDecNumber();
|
|
199
|
+
break;
|
|
200
|
+
case 4:
|
|
201
|
+
this.mcaller_pcode = i.readDecNumber();
|
|
202
|
+
this.mcaller_spec = i.readDecNumber();
|
|
203
|
+
this.mcaller_url = i.readDecNumber();
|
|
204
|
+
this.mthis_spec = i.readDecNumber();
|
|
205
|
+
break;
|
|
206
|
+
case 5:
|
|
207
|
+
this.mcaller_pcode = i.readDecNumber();
|
|
208
|
+
this.mcaller_oid = i.readDecNumber();
|
|
209
|
+
this.mcaller_spec = i.readDecNumber();
|
|
210
|
+
this.mcaller_url = i.readDecNumber();
|
|
211
|
+
this.mthis_spec = i.readDecNumber();
|
|
212
|
+
break;
|
|
213
|
+
case 6:
|
|
214
|
+
this.mcaller_pcode = i.readDecNumber();
|
|
215
|
+
this.mcaller_okind = i.readDecNumber();
|
|
216
|
+
this.mcaller_oid = i.readDecNumber();
|
|
217
|
+
this.mcaller_spec = i.readDecNumber();
|
|
218
|
+
this.mcaller_url = i.readDecNumber();
|
|
219
|
+
this.mthis_spec = i.readDecNumber();
|
|
220
|
+
break;
|
|
221
|
+
}
|
|
222
|
+
this.http_method = i.readByte();
|
|
223
|
+
this.domain = i.readDecNumber();
|
|
224
|
+
|
|
225
|
+
var n = i.readByte();
|
|
226
|
+
if (n > 0) {
|
|
227
|
+
this.fields = new Array(n);
|
|
228
|
+
for (var c = 0; c < n; c++) {
|
|
229
|
+
var id = i.readByte();
|
|
230
|
+
var value = i.readText();
|
|
231
|
+
this.fields[i] = {
|
|
232
|
+
id: id,
|
|
233
|
+
value: value
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (i.available() > 0) {
|
|
239
|
+
this.login = i.readDecNumber();
|
|
240
|
+
}
|
|
241
|
+
if (i.available() > 0) {
|
|
242
|
+
this.errorLevel = i.readByte();
|
|
243
|
+
} else {
|
|
244
|
+
if (this.error != 0) {
|
|
245
|
+
this.errorLevel = EventLevel.WARNING;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
if(i.available()>0) {
|
|
249
|
+
this.oid = i.readDecNumber();
|
|
250
|
+
this.okind = i.readDecNumber();
|
|
251
|
+
this.onode = i.readDecNumber();
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (i.available() > 0) {
|
|
255
|
+
this.custid = i.readText();
|
|
256
|
+
}
|
|
257
|
+
if (i.available() > 0) {
|
|
258
|
+
this.dbcTime = i.readDecNumber();
|
|
259
|
+
}
|
|
260
|
+
if (i.available() > 0) {
|
|
261
|
+
this.apdex = i.readByte();
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if(i.available()>0) {
|
|
265
|
+
this.mcallerStepId=i.readDecNumber();
|
|
266
|
+
this.originUrl=i.readText();
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
return this;
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
TxRecord.prototype.toBytes = function() {
|
|
273
|
+
var dout = new DataOutputX();
|
|
274
|
+
this.write(dout);
|
|
275
|
+
return dout.toByteArray();
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
TxRecord.prototype.toObject = function(b) {
|
|
279
|
+
var din = new DataInputX(b);
|
|
280
|
+
this.read(din);
|
|
281
|
+
return service;
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
TxRecord.HTTP_METHOD={"GET":1,"POST":2,"PUT":3,"DELETE":4,"PATCH":5,"OPTIONS":6,"HEAD":7,"TRACE":8};
|
|
285
|
+
TxRecord.WEB_GET = 1;
|
|
286
|
+
TxRecord.WEB_POST = 2;
|
|
287
|
+
TxRecord.WEB_PUT = 3;
|
|
288
|
+
TxRecord.WEB_DELETE = 4;
|
|
289
|
+
TxRecord.WEB_PATCH = 5;
|
|
290
|
+
TxRecord.WEB_OPTIONS = 6;
|
|
291
|
+
TxRecord.WEB_HEAD = 7;
|
|
292
|
+
TxRecord.WEB_TRACE = 8;
|
|
293
|
+
|
|
289
294
|
module.exports = TxRecord;
|