topbit 3.0.8 → 3.1.1
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/README.cn.md +2 -2
- package/README.md +2 -2
- package/demo/allow.js +28 -8
- package/demo/group-api.js +1 -1
- package/demo/group-api2.js +1 -1
- package/demo/monitor.js +81 -0
- package/package.json +1 -1
- package/src/extends/Http2Pool.js +143 -309
- package/src/extends/http2proxy.js +39 -141
- package/src/extends/proxy.js +16 -17
- package/src/monitor.js +102 -90
- package/src/topbit.js +8 -8
- package/test/test-route-sort.js +1 -1
- package/test/test-route2.js +1 -1
package/src/topbit.js
CHANGED
|
@@ -164,7 +164,7 @@ class Topbit {
|
|
|
164
164
|
* - maxFormLength 在multipart/form-data类型提交数据时,单个form项的最大值,默认为1000000字节。
|
|
165
165
|
* - errorHandle 收集错误并处理的函数,默认是输出错误信息,接收参数为两个,第一个是错误信息,第二个是错误的名字描述。
|
|
166
166
|
* - ignoreSlash 忽略末尾的/,默认为true。
|
|
167
|
-
* - maxLoadRate 在自动创建子进程平衡负载模式,最大子进程负载率限制:
|
|
167
|
+
* - maxLoadRate 在自动创建子进程平衡负载模式,最大子进程负载率限制:0.15 ~ 0.98。
|
|
168
168
|
* - streamTimeout http2Stream超时,若不设置,默认采用timeout的设置。
|
|
169
169
|
*/
|
|
170
170
|
constructor(options={}) {
|
|
@@ -272,7 +272,7 @@ class Topbit {
|
|
|
272
272
|
|
|
273
273
|
requestTimeout: 65_000,
|
|
274
274
|
|
|
275
|
-
maxLoadRate: 75
|
|
275
|
+
maxLoadRate: 0.75
|
|
276
276
|
};
|
|
277
277
|
|
|
278
278
|
this.whoami = 'topbit';
|
|
@@ -343,11 +343,11 @@ class Topbit {
|
|
|
343
343
|
break;
|
|
344
344
|
|
|
345
345
|
case 'monitorTimeSlice':
|
|
346
|
-
optionsCheck(k, options[k], this.config, {type: 'number', min: 5, max:
|
|
346
|
+
optionsCheck(k, options[k], this.config, {type: 'number', min: 5, max: 10000});
|
|
347
347
|
break;
|
|
348
|
-
|
|
348
|
+
|
|
349
349
|
case 'maxLoadRate':
|
|
350
|
-
optionsCheck(k, options[k], this.config, {type: 'number', min:
|
|
350
|
+
optionsCheck(k, options[k], this.config, {type: 'number', min: 0.15, max: 0.98});
|
|
351
351
|
break;
|
|
352
352
|
|
|
353
353
|
case 'maxFiles':
|
|
@@ -364,13 +364,13 @@ class Topbit {
|
|
|
364
364
|
case 'logHistory':
|
|
365
365
|
optionsCheck(k, options[k], this.config, {type: 'number', min: 1});
|
|
366
366
|
break;
|
|
367
|
-
|
|
367
|
+
|
|
368
368
|
case 'logType':
|
|
369
369
|
optionsCheck(k, options[k], this.config, {list: ['stdio','file', '']});
|
|
370
370
|
break;
|
|
371
371
|
|
|
372
372
|
case 'loadInfoType':
|
|
373
|
-
optionsCheck(k, options[k], this.config, {list: ['
|
|
373
|
+
optionsCheck(k, options[k], this.config, {list: [null, 'null', 'text', 'obj', 'orgobj']});
|
|
374
374
|
break;
|
|
375
375
|
|
|
376
376
|
case 'loadMonitor':
|
|
@@ -1110,7 +1110,7 @@ class Topbit {
|
|
|
1110
1110
|
total: 0
|
|
1111
1111
|
},
|
|
1112
1112
|
cpu: {user:0, system:0},
|
|
1113
|
-
cputm :
|
|
1113
|
+
cputm : 1000000
|
|
1114
1114
|
};
|
|
1115
1115
|
|
|
1116
1116
|
});
|
package/test/test-route-sort.js
CHANGED
package/test/test-route2.js
CHANGED