I new learning node js i want 100.000 web site uptime check monitor get header response.
I Use https://www.npmjs.com/package/ping-monitor class
How i can faster check and threading work, I add log mongoDB database
My Code
var urls = ["http://www.google.com",
"http://www.yahoo.com",
"http://www.website.com"];
async.map(urls, function(url, callback) {
try {
var myWebsite = new Monitor({
website: url,
interval: 1
});
myWebsite.on('error', function (msg) {
console.log(msg);
});
myWebsite.on('up', function (res) {
console.log('Website UP ' + res.website + ' .');
});
myWebsite.on('down', function (res) {
console.log('Oh Snap!! ' + res.website + ' is down! ' + res.statusMessage);
});
// this event is required to be handled in all Node-Monitor instances
myWebsite.on('error', function (res) {
console.log('Oh Snap!! An unexpected error occured trying to load ' + res.website + '!');
myWebsite.stop();
});
myWebsite.on('stop', function (website) {
console.log(website + ' monitor has stopped.');
});
}catch(e)
{
console.log("hata "+url);
}
setTimeout(function () {
callback("null", 'one')
console.log(url+" Başlayacak");
}, 0)
}, function(err, results) {
});