lib/master/masterAgent.js
function broadcastMonitors(records, moduleId, msg) {
    msg = protocol.composeRequest(null, moduleId, msg);

    if (records instanceof Array) {
        for (let i = 0, l = records.length; i < l; i++) {
            const socket = records[i].socket;
            doSend(socket, 'monitor', msg);
        }
    } else {
        for (const id in records) {
            if (records.hasOwnProperty(id)) {
                const socket = records[id].socket;
                doSend(socket, 'monitor', msg);
            }
        }
    }
}
function broadcastMonitors(records, moduleId, msg) {
    msg = protocol.composeRequest(null, moduleId, msg);

    if (records instanceof Array) {
        for (let i = 0, l = records.length; i < l; i++) {
            const socket = records[i].socket;
            doSend(socket, 'monitor', msg);
        }
    } else {
        for (const id in records) {
            if (records.hasOwnProperty(id)) {
                const socket = records[id].socket;
                doSend(socket, 'monitor', msg);
            }
        }
    }
}
function broadcastMonitors ( records , moduleId , msg ) { msg = protocol . composeRequest ( null , moduleId , msg ) ; if ( records instanceof Array ) { for ( let i = 0 , l = records . length ; i < l ; i ++ ) { const socket = records [ i ] . socket ; doSend ( socket , 'monitor' , msg ) ; } } else { for ( const id in records ) { if ( records . hasOwnProperty ( id ) ) { const socket = records [ id ] . socket ; doSend ( socket , 'monitor' , msg ) ; } } } }
broadcast msg to monitor

@param {Object} records registered modules
@param {String} moduleId module id/name
@param {Object} msg message
@api private
broadcast msg to monitor