Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cluster2

Package Overview
Dependencies
Maintainers
11
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cluster2 - npm Package Compare versions

Comparing version 0.5.0-SNAPSHOT.1387329311259 to 0.5.0-SNAPSHOT.1387334134740

50

lib/monitor.js

@@ -10,3 +10,13 @@ 'use strict';

var logger = process.getLogger(__filename),
var logger = function logger(){
if(!_.isFunction(process.getLogger)){
return {
'info': _.bind(console.log, console),
'debug': _.bind(console.log, console)
};
}
return process.getLogger(__filename);
},
monApp = express(),

@@ -44,3 +54,3 @@ masterPromise = require('./master').master,

logger.debug('[monitor][index] renders');
logger().debug('[monitor][index] renders');

@@ -72,3 +82,3 @@ res.render('index', {

logger.info('[monitor] server started');
logger().info('[monitor] server started');

@@ -81,3 +91,3 @@ var workers = _.once(function tick(){

logger.debug('[monitor][workers] pids:%j', pids);
logger().debug('[monitor][workers] pids:%j', pids);

@@ -90,3 +100,3 @@ when.map(master.status.statuses(), function(status){

logger.debug('[monitor][workers] statusesOfWorkers:%j', statusesOfWorkers);
logger().debug('[monitor][workers] statusesOfWorkers:%j', statusesOfWorkers);

@@ -111,3 +121,3 @@ _.each(statusesOfWorkers, function(statusOfWorkers){

logger.debug('[monitor][workers] emits status changes:%j', arrOfStatues);
logger().debug('[monitor][workers] emits status changes:%j', arrOfStatues);
socket.emit('status-change', pids, arrOfStatues);

@@ -117,3 +127,3 @@ }

logger.debug('[monitor][workers] detects workers changed:%j from:%j', pids, socket.knownPids);
logger().debug('[monitor][workers] detects workers changed:%j from:%j', pids, socket.knownPids);
socket.knownPids = pids;//update pids

@@ -135,3 +145,3 @@

logger.debug('[monitor][workers] renders workers view:%s', html);
logger().debug('[monitor][workers] renders workers view:%s', html);
socket.emit('workers', {

@@ -159,6 +169,6 @@ 'view': 'html',

logger.debug('[monitor][cache][%s] detects change of:%s', namespace, key);
logger().debug('[monitor][cache][%s] detects change of:%s', namespace, key);
usr.inspect(namespace, key).then(function(status){
logger.debug('[monitor][cache][%s] emits cache-changed event over websocket', namespace);
logger().debug('[monitor][cache][%s] emits cache-changed event over websocket', namespace);
_.invoke(sockets, 'emit', 'cache-changed', namespace, key, status[0], status[1], status[2]);

@@ -172,3 +182,3 @@ });

logger.info('[monitor][cache] detects new namespace:%s', namespace);
logger().info('[monitor][cache] detects new namespace:%s', namespace);
fs.readFile(path.join(__dirname, '/views/caches.ejs'), {

@@ -184,3 +194,3 @@ 'encoding': 'utf-8'

logger.debug('[monitor][cache][%s] renders empty caches view', namespace);
logger().debug('[monitor][cache][%s] renders empty caches view', namespace);
_.invoke(sockets, 'emit', 'caches', {

@@ -206,3 +216,3 @@ 'view': 'html',

logger.debug('[monitor][cache] existing namespaces:%s', namespaces);
logger().debug('[monitor][cache] existing namespaces:%s', namespaces);

@@ -215,3 +225,3 @@ _.each(namespaces || [], function(namespace){

logger.debug('[monitor][cache][%s] existing keys:%s', namespace, keys);
logger().debug('[monitor][cache][%s] existing keys:%s', namespace, keys);

@@ -241,3 +251,3 @@ when.map(keys, function(k){

logger.debug('[monitor][cache][%s] inspected:\n%s\nand renders caches view:\n%s', JSON.stringify(values), namespace, html);
logger().debug('[monitor][cache][%s] inspected:\n%s\nand renders caches view:\n%s', JSON.stringify(values), namespace, html);
_.each(sockets, function(socket){

@@ -275,3 +285,3 @@ if(!_.contains(socket.namespaces, namespace)){

logger.info('[monitor] accepted new websocket and sending workers & caches view');
logger().info('[monitor] accepted new websocket and sending workers & caches view');

@@ -292,3 +302,3 @@ socket.knownPids = [];

logger.info('[debug] %s requested', pid);
logger().info('[debug] %s requested', pid);

@@ -301,3 +311,3 @@ masterPromise.then(function(master){

master.emitter.to(['master']).emit('debug-started');
logger.info('debug:%s start requested', pid);
logger().info('debug:%s start requested', pid);
});

@@ -312,3 +322,3 @@

master.emitter.to(['master']).emit('debug-finished');
logger.info('[debug] %s finished', pid);
logger().info('[debug] %s finished', pid);
socket.once('debug', debug);

@@ -320,3 +330,3 @@ });

inspector = inspectorUrl;
logger.info('[debug] %s inspector ready:%s', pid, inspector);
logger().info('[debug] %s inspector ready:%s', pid, inspector);
socket.knownPids = [];//force an update

@@ -323,0 +333,0 @@ });

2

package.json

@@ -14,3 +14,3 @@ {

"name": "cluster2",
"version": "0.5.0-SNAPSHOT.1387329311259",
"version": "0.5.0-SNAPSHOT.1387334134740",
"engines": {

@@ -17,0 +17,0 @@ "node": ">= 0.10.0"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc