whatap 0.4.79 → 0.4.80
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 +704 -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 +288 -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 +134 -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/package.json +28 -28
- package/whatap.conf +1 -1
- package/logs/whatap-20230616.log +0 -13
package/lib/pack/netstat.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
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
|
-
function NETSTAT(){
|
|
8
|
-
this.est = 0;
|
|
9
|
-
this.fin_w = 0;
|
|
10
|
-
this.tim_w = 0;
|
|
11
|
-
this.clo_w = 0;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
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
|
+
function NETSTAT(){
|
|
8
|
+
this.est = 0;
|
|
9
|
+
this.fin_w = 0;
|
|
10
|
+
this.tim_w = 0;
|
|
11
|
+
this.clo_w = 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
15
|
module.exports = NETSTAT;
|
package/lib/pack/pack.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
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 Long = require('long');
|
|
8
|
-
var DateUtil = require('./../util/dateutil');
|
|
9
|
-
|
|
10
|
-
function Pack() {
|
|
11
|
-
this.pcode = 0; /*long*/
|
|
12
|
-
this.oid = 0; /*int*/
|
|
13
|
-
this.okind = 0;
|
|
14
|
-
this.onode = 0;
|
|
15
|
-
this.time = DateUtil.currentTime(); /*long*/
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
Pack.prototype.getPackType = function() {
|
|
19
|
-
return 0;
|
|
20
|
-
};
|
|
21
|
-
Pack.prototype.write = function(dout) {
|
|
22
|
-
if(this.okind===0 && this.onode ===0){
|
|
23
|
-
dout.writeDecimal(this.pcode);
|
|
24
|
-
dout.writeInt32BE(this.oid);
|
|
25
|
-
dout.writeLong(this.time);
|
|
26
|
-
}else{
|
|
27
|
-
dout.writeByte(9);
|
|
28
|
-
dout.writeDecimal(this.pcode);
|
|
29
|
-
dout.writeInt(this.oid);
|
|
30
|
-
dout.writeInt(this.okind);
|
|
31
|
-
dout.writeInt(this.onode);
|
|
32
|
-
dout.writeLong(this.time);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
Pack.prototype.read = function(din) {
|
|
36
|
-
var ver = din.readByte();
|
|
37
|
-
if(ver<=8) {
|
|
38
|
-
this.pcode = din.readDecNumberLen(ver);
|
|
39
|
-
this.oid = din.readInt();
|
|
40
|
-
this.time = din.readLong();
|
|
41
|
-
}else{
|
|
42
|
-
this.pcode=din.readDecimal();
|
|
43
|
-
this.oid = din.readInt();
|
|
44
|
-
this.okind = din.readInt();
|
|
45
|
-
this.onode = din.readInt();
|
|
46
|
-
this.time = din.readLong();
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
|
|
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 Long = require('long');
|
|
8
|
+
var DateUtil = require('./../util/dateutil');
|
|
9
|
+
|
|
10
|
+
function Pack() {
|
|
11
|
+
this.pcode = 0; /*long*/
|
|
12
|
+
this.oid = 0; /*int*/
|
|
13
|
+
this.okind = 0;
|
|
14
|
+
this.onode = 0;
|
|
15
|
+
this.time = DateUtil.currentTime(); /*long*/
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
Pack.prototype.getPackType = function() {
|
|
19
|
+
return 0;
|
|
20
|
+
};
|
|
21
|
+
Pack.prototype.write = function(dout) {
|
|
22
|
+
if(this.okind===0 && this.onode ===0){
|
|
23
|
+
dout.writeDecimal(this.pcode);
|
|
24
|
+
dout.writeInt32BE(this.oid);
|
|
25
|
+
dout.writeLong(this.time);
|
|
26
|
+
}else{
|
|
27
|
+
dout.writeByte(9);
|
|
28
|
+
dout.writeDecimal(this.pcode);
|
|
29
|
+
dout.writeInt(this.oid);
|
|
30
|
+
dout.writeInt(this.okind);
|
|
31
|
+
dout.writeInt(this.onode);
|
|
32
|
+
dout.writeLong(this.time);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
Pack.prototype.read = function(din) {
|
|
36
|
+
var ver = din.readByte();
|
|
37
|
+
if(ver<=8) {
|
|
38
|
+
this.pcode = din.readDecNumberLen(ver);
|
|
39
|
+
this.oid = din.readInt();
|
|
40
|
+
this.time = din.readLong();
|
|
41
|
+
}else{
|
|
42
|
+
this.pcode=din.readDecimal();
|
|
43
|
+
this.oid = din.readInt();
|
|
44
|
+
this.okind = din.readInt();
|
|
45
|
+
this.onode = din.readInt();
|
|
46
|
+
this.time = din.readLong();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
50
|
module.exports = Pack;
|
package/lib/pack/packenum.js
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
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
|
-
exports.PARAMETER = 0x0100;
|
|
8
|
-
exports.COUNTER_1 = 0x0201;
|
|
9
|
-
exports.PROFILE = 0x0300;
|
|
10
|
-
exports.ACTIVESTACK_1 = 0x0401;
|
|
11
|
-
exports.TEXT = 0x0700;
|
|
12
|
-
exports.ERROR_SNAP = 0x0800;
|
|
13
|
-
exports.ERROR_SNAP_1 = 0x0801;
|
|
14
|
-
exports.REALTIME_USER_1 = 0x0f01;
|
|
15
|
-
|
|
16
|
-
exports.STAT_SERVICE= 0x0900;
|
|
17
|
-
exports.STAT_SERVICE_1 = 0x0901;
|
|
18
|
-
exports.STAT_GENERAL= 0x0910;
|
|
19
|
-
exports.STAT_SQL = 0x0a00;
|
|
20
|
-
exports.STAT_HTTPC = 0x0b00;
|
|
21
|
-
exports.STAT_ERROR = 0x0c00;
|
|
22
|
-
exports.STAT_METHOD = 0x0e00;
|
|
23
|
-
exports.STAT_TOP_SERVICE= 0x1000;
|
|
24
|
-
exports.STAT_REMOTE_IP = 0x1100;
|
|
25
|
-
exports.STAT_USER_AGENT = 0x1200;
|
|
26
|
-
|
|
27
|
-
exports.EVENT = 0x1400;
|
|
28
|
-
exports.HITMAP = 0x1500;
|
|
29
|
-
exports.HITMAP_1 = 0x1501;
|
|
30
|
-
exports.COUNTER5M = 0x1600;
|
|
31
|
-
exports.HITMAP5M = 0x1700;
|
|
32
|
-
|
|
33
|
-
exports.TAG_COUNT = 0x1601;
|
|
34
|
-
|
|
35
|
-
exports.PACK_NAME = {
|
|
36
|
-
0x0100 : 'PARAMETER',
|
|
37
|
-
0x0201 : 'COUNTER_1',
|
|
38
|
-
0x0300 : 'PROFILE',
|
|
39
|
-
0x0401 : 'ACTIVESTACK_1',
|
|
40
|
-
0x0700 : 'TEXT',
|
|
41
|
-
0x0800 : 'ERROR_SNAP',
|
|
42
|
-
0x0801 : 'ERROR_SNAP_1',
|
|
43
|
-
0x0f01 : 'REALTIME_USER_1',
|
|
44
|
-
0x0900 : 'STAT_SERVICE',
|
|
45
|
-
0x0901 : 'STAT_SERVICE_1',
|
|
46
|
-
0x0910 : 'STAT_GENERAL',
|
|
47
|
-
0x0a00 : 'STAT_SQL',
|
|
48
|
-
0x0b00 : 'STAT_HTTPC',
|
|
49
|
-
0x0c00 : 'STAT_ERROR',
|
|
50
|
-
0x0e00 : 'STAT_METHOD',
|
|
51
|
-
0x1000 : 'STAT_TOP_SERVICE',
|
|
52
|
-
0x1100 : 'STAT_REMOTE_IP',
|
|
53
|
-
0x1200 : 'STAT_USER_AGENT',
|
|
54
|
-
0x1400 : 'EVENT',
|
|
55
|
-
0x1500 : 'HITMAP',
|
|
56
|
-
0x1501 : 'HITMAP_1',
|
|
57
|
-
0x1600 : 'COUNTER5M',
|
|
58
|
-
0x1700 : 'HITMAP5M',
|
|
59
|
-
0x1601 : 'TAG_COUNT'
|
|
60
|
-
};
|
|
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
|
+
exports.PARAMETER = 0x0100;
|
|
8
|
+
exports.COUNTER_1 = 0x0201;
|
|
9
|
+
exports.PROFILE = 0x0300;
|
|
10
|
+
exports.ACTIVESTACK_1 = 0x0401;
|
|
11
|
+
exports.TEXT = 0x0700;
|
|
12
|
+
exports.ERROR_SNAP = 0x0800;
|
|
13
|
+
exports.ERROR_SNAP_1 = 0x0801;
|
|
14
|
+
exports.REALTIME_USER_1 = 0x0f01;
|
|
15
|
+
|
|
16
|
+
exports.STAT_SERVICE= 0x0900;
|
|
17
|
+
exports.STAT_SERVICE_1 = 0x0901;
|
|
18
|
+
exports.STAT_GENERAL= 0x0910;
|
|
19
|
+
exports.STAT_SQL = 0x0a00;
|
|
20
|
+
exports.STAT_HTTPC = 0x0b00;
|
|
21
|
+
exports.STAT_ERROR = 0x0c00;
|
|
22
|
+
exports.STAT_METHOD = 0x0e00;
|
|
23
|
+
exports.STAT_TOP_SERVICE= 0x1000;
|
|
24
|
+
exports.STAT_REMOTE_IP = 0x1100;
|
|
25
|
+
exports.STAT_USER_AGENT = 0x1200;
|
|
26
|
+
|
|
27
|
+
exports.EVENT = 0x1400;
|
|
28
|
+
exports.HITMAP = 0x1500;
|
|
29
|
+
exports.HITMAP_1 = 0x1501;
|
|
30
|
+
exports.COUNTER5M = 0x1600;
|
|
31
|
+
exports.HITMAP5M = 0x1700;
|
|
32
|
+
|
|
33
|
+
exports.TAG_COUNT = 0x1601;
|
|
34
|
+
|
|
35
|
+
exports.PACK_NAME = {
|
|
36
|
+
0x0100 : 'PARAMETER',
|
|
37
|
+
0x0201 : 'COUNTER_1',
|
|
38
|
+
0x0300 : 'PROFILE',
|
|
39
|
+
0x0401 : 'ACTIVESTACK_1',
|
|
40
|
+
0x0700 : 'TEXT',
|
|
41
|
+
0x0800 : 'ERROR_SNAP',
|
|
42
|
+
0x0801 : 'ERROR_SNAP_1',
|
|
43
|
+
0x0f01 : 'REALTIME_USER_1',
|
|
44
|
+
0x0900 : 'STAT_SERVICE',
|
|
45
|
+
0x0901 : 'STAT_SERVICE_1',
|
|
46
|
+
0x0910 : 'STAT_GENERAL',
|
|
47
|
+
0x0a00 : 'STAT_SQL',
|
|
48
|
+
0x0b00 : 'STAT_HTTPC',
|
|
49
|
+
0x0c00 : 'STAT_ERROR',
|
|
50
|
+
0x0e00 : 'STAT_METHOD',
|
|
51
|
+
0x1000 : 'STAT_TOP_SERVICE',
|
|
52
|
+
0x1100 : 'STAT_REMOTE_IP',
|
|
53
|
+
0x1200 : 'STAT_USER_AGENT',
|
|
54
|
+
0x1400 : 'EVENT',
|
|
55
|
+
0x1500 : 'HITMAP',
|
|
56
|
+
0x1501 : 'HITMAP_1',
|
|
57
|
+
0x1600 : 'COUNTER5M',
|
|
58
|
+
0x1700 : 'HITMAP5M',
|
|
59
|
+
0x1601 : 'TAG_COUNT'
|
|
60
|
+
};
|
|
61
61
|
|
package/lib/pack/param-pack.js
CHANGED
|
@@ -1,214 +1,214 @@
|
|
|
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
|
-
|
|
8
|
-
var Pack = require('./pack'),
|
|
9
|
-
Long = require('long'),
|
|
10
|
-
StringKeyLinkedMap = require('../util/stringkey-linkedmap'),
|
|
11
|
-
PackEnum = require('./packenum'),
|
|
12
|
-
BooleanValue = require('../value/boolean-value'),
|
|
13
|
-
NumberValue = require('../value/number-value'),
|
|
14
|
-
TextValue = require('../value/text-value'),
|
|
15
|
-
DecimalValue = require('../value/decimal-value'),
|
|
16
|
-
ListValue = require('../value/list-value'),
|
|
17
|
-
MapValue = require('../value/map-value');
|
|
18
|
-
|
|
19
|
-
function ParamPack() {
|
|
20
|
-
Pack.call(this);
|
|
21
|
-
|
|
22
|
-
this.id = 0;
|
|
23
|
-
this.table = new StringKeyLinkedMap();
|
|
24
|
-
this.request = Long.ZERO;
|
|
25
|
-
this.response = Long.ZERO;
|
|
26
|
-
|
|
27
|
-
this.size = function () {
|
|
28
|
-
return this.table.size();
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
this.isEmpty = function () {
|
|
32
|
-
return this.size() === 0
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
this.containsKey = function (key) {
|
|
36
|
-
return this.table.containsKey(key);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
this.keys = function () {
|
|
40
|
-
return this.table.keys();
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
this.getValue = function (key) {
|
|
44
|
-
return this.table.get(key);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
this.getBoolean = function (key) {
|
|
48
|
-
var v = this.getValue(key);
|
|
49
|
-
if(v instanceof BooleanValue) {
|
|
50
|
-
return v.value;
|
|
51
|
-
}
|
|
52
|
-
return false;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
this.getInt = function (key) {
|
|
56
|
-
var v = this.getValue(key);
|
|
57
|
-
if(v instanceof NumberValue) {
|
|
58
|
-
return v.intValue();
|
|
59
|
-
}
|
|
60
|
-
return 0;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
this.getLong = function (key) {
|
|
64
|
-
var v = this.getValue(key);
|
|
65
|
-
if(v instanceof NumberValue) {
|
|
66
|
-
return v.longValue();
|
|
67
|
-
}
|
|
68
|
-
return Long.ZERO;
|
|
69
|
-
};
|
|
70
|
-
this.getNumber = function (key) {
|
|
71
|
-
var v = this.getValue(key);
|
|
72
|
-
if(v instanceof NumberValue) {
|
|
73
|
-
return v.numberValue();
|
|
74
|
-
}
|
|
75
|
-
return 0;
|
|
76
|
-
};
|
|
77
|
-
this.getLong = function (key) {
|
|
78
|
-
var v = this.getValue(key);
|
|
79
|
-
if(v instanceof NumberValue) {
|
|
80
|
-
return v.longValue();
|
|
81
|
-
}
|
|
82
|
-
return 0;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
this.getFloat = function (key) {
|
|
87
|
-
var v = this.getValue(key);
|
|
88
|
-
if(v instanceof NumberValue) {
|
|
89
|
-
return v.floatValue();
|
|
90
|
-
}
|
|
91
|
-
return 0;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
this.getText = function (key) {
|
|
95
|
-
var v = this.getValue(key);
|
|
96
|
-
if(v instanceof TextValue) {
|
|
97
|
-
return v.value;
|
|
98
|
-
}
|
|
99
|
-
return null;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
this.putValue = function (key, value) {
|
|
103
|
-
this.table.put(key, value);
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
this.putString = function (key, value) {
|
|
107
|
-
var v = new TextValue(value);
|
|
108
|
-
this.table.put(key, v);
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
this.putLong = function (key, value) {
|
|
112
|
-
var v = new DecimalValue(value);
|
|
113
|
-
this.table.put(key, v);
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
this.remove = function (key) {
|
|
117
|
-
return this.table.remove(key);
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
this.clear = function () {
|
|
121
|
-
this.table.clear();
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
this.newList = function (name) {
|
|
125
|
-
var list = new ListValue();
|
|
126
|
-
this.putValue(name, list);
|
|
127
|
-
return list;
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
this.hashCode = function () {
|
|
131
|
-
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
this.equals = function (object) {
|
|
135
|
-
return this === object;
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
this.toMapValue = function () {
|
|
139
|
-
var map = new MapValue();
|
|
140
|
-
var en = this.table.keys();
|
|
141
|
-
while(en.hasMoreElements()){
|
|
142
|
-
var k = en.nextElement();
|
|
143
|
-
var v = this.table.get(k);
|
|
144
|
-
map.putValue(k,v);
|
|
145
|
-
}
|
|
146
|
-
return map;
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
this.setMapValue = function (mapValue) {
|
|
150
|
-
if(mapValue == null) {
|
|
151
|
-
return this;
|
|
152
|
-
}
|
|
153
|
-
if((mapValue instanceof MapValue) === false) {
|
|
154
|
-
return this;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
var k,v;
|
|
158
|
-
var en = mapValue.keys();
|
|
159
|
-
while(en.hasMoreElements()){
|
|
160
|
-
k = en.nextElement();
|
|
161
|
-
v = mapValue.get(k);
|
|
162
|
-
this.putValue(k,v);
|
|
163
|
-
}
|
|
164
|
-
return this;
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
this.getResponse = function () {
|
|
168
|
-
if(this.request === 0) {
|
|
169
|
-
return this;
|
|
170
|
-
}
|
|
171
|
-
this.response = this.request;
|
|
172
|
-
this.request = 0;
|
|
173
|
-
return this;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
ParamPack.prototype = new Pack();
|
|
178
|
-
ParamPack.prototype.constructor = ParamPack;
|
|
179
|
-
ParamPack.prototype.getPackType = function () {
|
|
180
|
-
return PackEnum.PARAMETER;
|
|
181
|
-
};
|
|
182
|
-
ParamPack.prototype.write = function (dout) {
|
|
183
|
-
Pack.prototype.write.call(this, dout);
|
|
184
|
-
dout.writeInt(this.id);
|
|
185
|
-
dout.writeDecimal(this.request);
|
|
186
|
-
dout.writeDecimal(this.response);
|
|
187
|
-
dout.writeDecimal(this.table.size());
|
|
188
|
-
|
|
189
|
-
var key,val;
|
|
190
|
-
var en = this.keys();
|
|
191
|
-
while(en.hasMoreElements()){
|
|
192
|
-
key = en.nextElement();
|
|
193
|
-
val = this.table.get(key);
|
|
194
|
-
dout.writeText(key);
|
|
195
|
-
dout.writeValue(val);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
};
|
|
199
|
-
ParamPack.prototype.read = function (din) {
|
|
200
|
-
Pack.prototype.read.call(this, din);
|
|
201
|
-
this.id = din.readInt();
|
|
202
|
-
this.request = din.readDecLong();
|
|
203
|
-
this.response = din.readDecLong();
|
|
204
|
-
var count = din.readDecNumber();
|
|
205
|
-
var key, val;
|
|
206
|
-
for(var i=0; i<count; i++) {
|
|
207
|
-
key = din.readText();
|
|
208
|
-
val = din.readValue();
|
|
209
|
-
this.putValue(key, val);
|
|
210
|
-
}
|
|
211
|
-
return this;
|
|
212
|
-
};
|
|
213
|
-
|
|
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
|
+
|
|
8
|
+
var Pack = require('./pack'),
|
|
9
|
+
Long = require('long'),
|
|
10
|
+
StringKeyLinkedMap = require('../util/stringkey-linkedmap'),
|
|
11
|
+
PackEnum = require('./packenum'),
|
|
12
|
+
BooleanValue = require('../value/boolean-value'),
|
|
13
|
+
NumberValue = require('../value/number-value'),
|
|
14
|
+
TextValue = require('../value/text-value'),
|
|
15
|
+
DecimalValue = require('../value/decimal-value'),
|
|
16
|
+
ListValue = require('../value/list-value'),
|
|
17
|
+
MapValue = require('../value/map-value');
|
|
18
|
+
|
|
19
|
+
function ParamPack() {
|
|
20
|
+
Pack.call(this);
|
|
21
|
+
|
|
22
|
+
this.id = 0;
|
|
23
|
+
this.table = new StringKeyLinkedMap();
|
|
24
|
+
this.request = Long.ZERO;
|
|
25
|
+
this.response = Long.ZERO;
|
|
26
|
+
|
|
27
|
+
this.size = function () {
|
|
28
|
+
return this.table.size();
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
this.isEmpty = function () {
|
|
32
|
+
return this.size() === 0
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
this.containsKey = function (key) {
|
|
36
|
+
return this.table.containsKey(key);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
this.keys = function () {
|
|
40
|
+
return this.table.keys();
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
this.getValue = function (key) {
|
|
44
|
+
return this.table.get(key);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
this.getBoolean = function (key) {
|
|
48
|
+
var v = this.getValue(key);
|
|
49
|
+
if(v instanceof BooleanValue) {
|
|
50
|
+
return v.value;
|
|
51
|
+
}
|
|
52
|
+
return false;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
this.getInt = function (key) {
|
|
56
|
+
var v = this.getValue(key);
|
|
57
|
+
if(v instanceof NumberValue) {
|
|
58
|
+
return v.intValue();
|
|
59
|
+
}
|
|
60
|
+
return 0;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
this.getLong = function (key) {
|
|
64
|
+
var v = this.getValue(key);
|
|
65
|
+
if(v instanceof NumberValue) {
|
|
66
|
+
return v.longValue();
|
|
67
|
+
}
|
|
68
|
+
return Long.ZERO;
|
|
69
|
+
};
|
|
70
|
+
this.getNumber = function (key) {
|
|
71
|
+
var v = this.getValue(key);
|
|
72
|
+
if(v instanceof NumberValue) {
|
|
73
|
+
return v.numberValue();
|
|
74
|
+
}
|
|
75
|
+
return 0;
|
|
76
|
+
};
|
|
77
|
+
this.getLong = function (key) {
|
|
78
|
+
var v = this.getValue(key);
|
|
79
|
+
if(v instanceof NumberValue) {
|
|
80
|
+
return v.longValue();
|
|
81
|
+
}
|
|
82
|
+
return 0;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
this.getFloat = function (key) {
|
|
87
|
+
var v = this.getValue(key);
|
|
88
|
+
if(v instanceof NumberValue) {
|
|
89
|
+
return v.floatValue();
|
|
90
|
+
}
|
|
91
|
+
return 0;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
this.getText = function (key) {
|
|
95
|
+
var v = this.getValue(key);
|
|
96
|
+
if(v instanceof TextValue) {
|
|
97
|
+
return v.value;
|
|
98
|
+
}
|
|
99
|
+
return null;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
this.putValue = function (key, value) {
|
|
103
|
+
this.table.put(key, value);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
this.putString = function (key, value) {
|
|
107
|
+
var v = new TextValue(value);
|
|
108
|
+
this.table.put(key, v);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
this.putLong = function (key, value) {
|
|
112
|
+
var v = new DecimalValue(value);
|
|
113
|
+
this.table.put(key, v);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
this.remove = function (key) {
|
|
117
|
+
return this.table.remove(key);
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
this.clear = function () {
|
|
121
|
+
this.table.clear();
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
this.newList = function (name) {
|
|
125
|
+
var list = new ListValue();
|
|
126
|
+
this.putValue(name, list);
|
|
127
|
+
return list;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
this.hashCode = function () {
|
|
131
|
+
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
this.equals = function (object) {
|
|
135
|
+
return this === object;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
this.toMapValue = function () {
|
|
139
|
+
var map = new MapValue();
|
|
140
|
+
var en = this.table.keys();
|
|
141
|
+
while(en.hasMoreElements()){
|
|
142
|
+
var k = en.nextElement();
|
|
143
|
+
var v = this.table.get(k);
|
|
144
|
+
map.putValue(k,v);
|
|
145
|
+
}
|
|
146
|
+
return map;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
this.setMapValue = function (mapValue) {
|
|
150
|
+
if(mapValue == null) {
|
|
151
|
+
return this;
|
|
152
|
+
}
|
|
153
|
+
if((mapValue instanceof MapValue) === false) {
|
|
154
|
+
return this;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
var k,v;
|
|
158
|
+
var en = mapValue.keys();
|
|
159
|
+
while(en.hasMoreElements()){
|
|
160
|
+
k = en.nextElement();
|
|
161
|
+
v = mapValue.get(k);
|
|
162
|
+
this.putValue(k,v);
|
|
163
|
+
}
|
|
164
|
+
return this;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
this.getResponse = function () {
|
|
168
|
+
if(this.request === 0) {
|
|
169
|
+
return this;
|
|
170
|
+
}
|
|
171
|
+
this.response = this.request;
|
|
172
|
+
this.request = 0;
|
|
173
|
+
return this;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
ParamPack.prototype = new Pack();
|
|
178
|
+
ParamPack.prototype.constructor = ParamPack;
|
|
179
|
+
ParamPack.prototype.getPackType = function () {
|
|
180
|
+
return PackEnum.PARAMETER;
|
|
181
|
+
};
|
|
182
|
+
ParamPack.prototype.write = function (dout) {
|
|
183
|
+
Pack.prototype.write.call(this, dout);
|
|
184
|
+
dout.writeInt(this.id);
|
|
185
|
+
dout.writeDecimal(this.request);
|
|
186
|
+
dout.writeDecimal(this.response);
|
|
187
|
+
dout.writeDecimal(this.table.size());
|
|
188
|
+
|
|
189
|
+
var key,val;
|
|
190
|
+
var en = this.keys();
|
|
191
|
+
while(en.hasMoreElements()){
|
|
192
|
+
key = en.nextElement();
|
|
193
|
+
val = this.table.get(key);
|
|
194
|
+
dout.writeText(key);
|
|
195
|
+
dout.writeValue(val);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
};
|
|
199
|
+
ParamPack.prototype.read = function (din) {
|
|
200
|
+
Pack.prototype.read.call(this, din);
|
|
201
|
+
this.id = din.readInt();
|
|
202
|
+
this.request = din.readDecLong();
|
|
203
|
+
this.response = din.readDecLong();
|
|
204
|
+
var count = din.readDecNumber();
|
|
205
|
+
var key, val;
|
|
206
|
+
for(var i=0; i<count; i++) {
|
|
207
|
+
key = din.readText();
|
|
208
|
+
val = din.readValue();
|
|
209
|
+
this.putValue(key, val);
|
|
210
|
+
}
|
|
211
|
+
return this;
|
|
212
|
+
};
|
|
213
|
+
|
|
214
214
|
module.exports.ParamPack = ParamPack;
|