Skip to content

Commit 36c7d3c

Browse files
committed
[process] change title
1 parent 7d932ad commit 36c7d3c

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

api/api.js

+15
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@ const log = require('./utils/log.js')('core:api');
99
const common = require('./utils/common.js');
1010
const {processRequest} = require('./utils/requestProcessor');
1111

12+
var t = ["countly:", "api"];
13+
14+
if (cluster.isMaster) {
15+
t.push("master");
16+
t.push("node");
17+
t.push(process.argv[1]);
18+
}
19+
else{
20+
t.push("worker");
21+
t.push("node");
22+
}
23+
24+
// Finaly set the visible title
25+
process.title = t.join(' ');
26+
1227
let workers = [];
1328

1429
/**

api/parts/jobs/executor.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

3+
process.title = "countly: executor "+process.pid+" node "+process.argv[1];
4+
35
process.on('uncaughtException', (err) => {
46
console.log('Caught exception: %j', err, err.stack);
57
process.exit(1);

frontend/express/app.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Set process name
2+
process.title = "countly: dashboard node "+process.argv[1];
3+
14
var versionInfo = require('./version.info'),
25
COUNTLY_VERSION = versionInfo.version,
36
COUNTLY_TYPE = versionInfo.type,

0 commit comments

Comments
 (0)