Comments (3)
They're handled quite nicely. What specifically do you want to know about them? Node-monitor connects many processes together.
from node-monitor.
Excellent to hear.
I am developing an app using "cluster" and wanted to monitor the app as a whole but wasn't sure this module has the capability. I'll give it a test. Thanks
from node-monitor.
Hi Loren
Would you be able to elaborate a bit on this connection of processes done by node-monitor?
In my case I have an app using cluster that goes something like this:
// index.js
var restify = require('restify');
var os = require('os');
var cluster = require('cluster');
var config = require('config');
var Monitor = require('monitor');
var monitorServer = new Monitor.Server();
monitorServer.on('start', function () {
console.log('Monitor server listening at port %d', monitorServer.get('port'));
});
monitorServer.start();
var nodes = Math.min(process.env.NODES || 1, os.cpus().length - 1);
if (cluster.isMaster) {
console.log('Master %d creating %d forks', process.pid, nodes);
for (var i = 0; i < nodes; i++) {
cluster.fork();
}
cluster.on('online', function (worker) {
console.log('Worker %d is online', worker.process.pid);
});
cluster.on('exit', function (worker, code, signal) {
cluster.fork();
});
} else {
var server = restify.createServer({
name: 'Monitored RESTified API'
});
server.listen(8080, function () {
console.log('%s server listening at %s', server.name, server.url);
});
}
Now, if e.g. I run this app with 5 forks, it logs as follows:
$ NODES=5 node index.js
Master 4945 creating 5 forks
Monitor server listening at port 42000
Worker 4946 is online
Worker 4949 is online
Worker 4948 is online
Worker 4950 is online
Worker 4947 is online
Monitored RESTified API server listening at http://0.0.0.0:8080
Monitor server listening at port 42001
Monitored RESTified API server listening at http://0.0.0.0:8080
Monitor server listening at port 42001
Monitored RESTified API server listening at http://0.0.0.0:8080
Monitor server listening at port 42001
Monitored RESTified API server listening at http://0.0.0.0:8080
Monitor server listening at port 42001
Monitored RESTified API server listening at http://0.0.0.0:8080
Monitor server listening at port 42001
Then starting up monitor-dashboard I find two monitor server app instances, whose PIDs are the ones of the master and the last fork.
By connection do you mean that these two monitor server app instances include values from all of my 6 running processes? Alternatively, is there a way to assure the creation of one monitor server app instance per node process, 6 in total in my case?
from node-monitor.
Related Issues (20)
- Removing components HOT 2
- "Add component" needs scrollbar by default. HOT 1
- npm start monitor failed HOT 1
- Support for HTTP monitoring? HOT 1
- Test with a remote Server HOT 3
- Troubles running example scripts on Mac HOT 5
- Monitor an application from Browser HOT 2
- node-monitor crashes HOT 2
- error running monitor HOT 4
- Error watching for file (runtime.json) ENOSPC HOT 3
- Need more examples HOT 5
- process.EventEmitter is deprecated in Node.js v6.*.* HOT 4
- Cannot get output when running a nodejs script file HOT 1
- How can I add additional data to the monitor result? HOT 4
- getConnection() return null
- Build error on install HOT 1
- Monitor information do not getting correctly in docker container HOT 1
- Waiting for response HOT 1
- Page onInit doesn't save HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-monitor.