whatap 0.5.5 → 0.5.7
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.
|
@@ -20,17 +20,19 @@ SystemECSTask.prototype.process = function (p) {
|
|
|
20
20
|
|
|
21
21
|
var ecs = AwsEcsClientThread;
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
setTimeout(() => {
|
|
24
|
+
p.cpu = ecs.cpu * conf.correction_factor_cpu;
|
|
25
|
+
p.cpu_sys = ecs.cpu_sys;
|
|
26
|
+
p.cpu_usr = ecs.cpu_user;
|
|
27
|
+
p.mem = ecs.mem_pct;
|
|
28
|
+
|
|
29
|
+
if (ecs.millicore > 0) {
|
|
30
|
+
p.metering = ecs.millicore / 1024;
|
|
31
|
+
p.cpu_cores = Math.ceil(p.metering);
|
|
32
|
+
} else {
|
|
33
|
+
p.metering = p.cpu_cores;
|
|
34
|
+
}
|
|
35
|
+
}, 500);
|
|
34
36
|
|
|
35
37
|
};
|
|
36
38
|
|
package/lib/util/nodeutil.js
CHANGED
|
@@ -6,19 +6,23 @@
|
|
|
6
6
|
|
|
7
7
|
var fs = require('fs'),
|
|
8
8
|
path = require('path');
|
|
9
|
+
const { execSync } = require('child_process');
|
|
9
10
|
|
|
10
|
-
function getPackageJson(){
|
|
11
|
-
var appDir = require('./../conf/configure')['app.root'];
|
|
11
|
+
function getPackageJson() {
|
|
12
12
|
try {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
'node_modules',
|
|
16
|
-
'whatap',
|
|
17
|
-
'package.json');
|
|
18
|
-
NodeUtil.packageJson = require(whatap_path, 'utf8');
|
|
13
|
+
const whatapPath = require.resolve('whatap/package.json');
|
|
14
|
+
NodeUtil.packageJson = require(whatapPath);
|
|
19
15
|
return;
|
|
20
16
|
} catch(e) {
|
|
21
17
|
}
|
|
18
|
+
|
|
19
|
+
try{
|
|
20
|
+
const globalPath = execSync('npm root -g').toString().trim();
|
|
21
|
+
const globalWhatapPath = path.join(globalPath, 'whatap', 'package.json');
|
|
22
|
+
NodeUtil.packageJson = require(globalWhatapPath);
|
|
23
|
+
return;
|
|
24
|
+
}catch (e) {
|
|
25
|
+
}
|
|
22
26
|
NodeUtil.packageJson = {};
|
|
23
27
|
}
|
|
24
28
|
function recursiveCall(fullPath, file, cb){
|
|
@@ -65,4 +69,4 @@ var NodeUtil = {
|
|
|
65
69
|
packageJson : {}
|
|
66
70
|
};
|
|
67
71
|
|
|
68
|
-
module.exports = NodeUtil;
|
|
72
|
+
module.exports = NodeUtil;
|
package/package.json
CHANGED