whatap 0.4.67 → 0.4.68
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.
|
@@ -279,8 +279,7 @@ MysqlObserver.prototype.inject = function (mod, moduleName) {
|
|
|
279
279
|
|
|
280
280
|
|
|
281
281
|
var dbc_pool_hash=0;
|
|
282
|
-
aop.after(mod, ['createPool'
|
|
283
|
-
|
|
282
|
+
aop.after(mod, ['createPool'], function (obj, args, ret) {
|
|
284
283
|
var dbc = 'mysql://';
|
|
285
284
|
if(dbc_pool_hash==0){
|
|
286
285
|
if(args.length > 0) {
|
|
@@ -322,10 +321,11 @@ MysqlObserver.prototype.inject = function (mod, moduleName) {
|
|
|
322
321
|
aop.before(conn._protocol, '_delegateError', errorDelegate(ctx));
|
|
323
322
|
});
|
|
324
323
|
}, function (obj, args, ret, lctx) {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
324
|
+
if(obj._allConnections != undefined) {
|
|
325
|
+
var all = obj._allConnections.length;
|
|
326
|
+
var idle = obj._freeConnections.length;
|
|
327
|
+
MeterSql.setConnection((all - idle), idle, dbc);
|
|
328
|
+
}
|
|
329
329
|
});
|
|
330
330
|
});
|
|
331
331
|
};
|
package/lib/util/kube-util.js
CHANGED
|
@@ -17,8 +17,18 @@ var KubeUtil = {
|
|
|
17
17
|
for(var i = 0 ; i < contents.length ; i++){
|
|
18
18
|
var line = contents[i];
|
|
19
19
|
if(line){
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
if(line.indexOf("/ecs/") >= 0) {
|
|
21
|
+
this.container_id = line.substr(line.lastIndexOf('/')+1) || '';
|
|
22
|
+
} else{
|
|
23
|
+
//this.container_id = line.substr(line.lastIndexOf('/')+1) || '';
|
|
24
|
+
//this.container_id = this.container_id.replace(/^(docker-)+|(cri-containerd-)+|(crio-)+|(\\.scope)+$/ig, "");
|
|
25
|
+
//container_id = container_id.replace(/^(docker-)+|(cri-)+|(cri-containerd-)+|(crio-)+|(.scope)+$/ig, "");
|
|
26
|
+
this.container_id = line.substr(line.lastIndexOf('/')+1) || '';
|
|
27
|
+
this.container_id = this.container_id.replace(/^|(.scope)+$/ig, "");
|
|
28
|
+
this.container_id = this.container_id.substr(this.container_id.lastIndexOf('-')+1);
|
|
29
|
+
this.container_id = this.container_id.substr(this.container_id.lastIndexOf(':')+1);
|
|
30
|
+
}
|
|
31
|
+
|
|
22
32
|
if(this.container_id.length > 5){
|
|
23
33
|
this.container_key = HashUtil2.hash(this.container_id);
|
|
24
34
|
break;
|
package/package.json
CHANGED