How to use the node.procs function in node

To help you get started, we’ve selected a few node examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github uavorg / uavstack / com.creditease.uav.console / src / main / webapp / uavapp_godeye / uavnetwork / js / uav.network.js View on Github external
var memoryMax = datas["os.cpu.maxmem"];
			var memoryFreeme = datas["os.cpu.freemem"];
			var memoryUsed=(memoryMax - memoryFreeme);
			var memoryPro = Math.ceil((memoryUsed/ memoryMax) * 100);
			
			//connections
	        var curconn=datas["os.conn.cur"];
	        //process total mem
	        var procMemSum=0;
	        //process total flux
	        var inFluxSum=0;
	        var outFluxSum=0;

	        // sum real connections from proc's conn
	        if(datas['node.procs']){
	    		var procs = JSON.parse(datas['node.procs']);
	    		var procConnSum = 0;
	    		
	    		for (var k in procs){
	    			if(procs[k].tags.conn){
	    				procConnSum += parseInt(procs[k].tags.conn);
	    			}
	    			
	    			if(procs[k].tags.mem){ 
	    				procMemSum+=parseInt(procs[k].tags.mem)*1024;
	    			}

	    			if(procs[k].tags["in"]){ 
	    				inFluxSum+=parseFloat(procs[k].tags["in"]);
	    			}

	    			if(procs[k].tags.out){
github uavorg / uavstack / com.creditease.uav.console / src / main / webapp / uavapp_godeye / timesandtable / js / uav.tstable.js View on Github external
function getProcInstid(appurl,ip) {
	var isJse = appurl.indexOf("http:") == -1?true:false;
	var port,pid,pname,infoinfo,jsepid,result;
	var result;
	for ( var key in nodeData) {
		var dataObj = eval("("+nodeData[key]+")");
		 
		var infoValue = dataObj["info"];
		 
		var ipValue = dataObj["ip"];
		if(ip!=ipValue) {
			continue;			
		}
		infoinfo = infoValue;		
		 
		var procs=eval("("+infoinfo["node.procs"]+")");
		 
		if(procs==undefined) {
			continue;
		}
		else{
			break;
		}
	}
	if (isJse) {
		var jseInfo=appurl.split("-");
		jsepid=jseInfo[jseInfo.length-1];
		
		for(var key in procs) {								
			 if(jsepid==key) {
				 pid=key;
				 pname=procs[key]["name"];
github uavorg / uavstack / com.creditease.uav.console / src / main / webapp / uavapp_godeye / uavnetwork / js / uav.network.js View on Github external
runWindowDelay:function(tag) {
			if (window["openlink_"+tag]==undefined) {
				return;
			}
			
			var info=window["openlink_"+tag];
			window["openlink_"+tag]=undefined;
			if (tag=="procinfo") {
				
				var pid=info["pid"];
				//need find pid by port
				if (pid==undefined) {
					var macInfo=app.mdata("macinfo")[info["ip"]];
					
					var procs=eval("("+macInfo["node.procs"]+")");
					
					for(var key in procs) {
						
						var proc=procs[key];
						
						var ports=proc["ports"];
						
						for(var i=0;i
github uavorg / uavstack / com.creditease.uav.console / src / main / webapp / uavapp_godeye / uavnetwork / js / uav.network.js View on Github external
runProcessChart: function(ip,pid,forceUpdate,needCache) {
			
			var datas = app.mdata().macinfo[ip];
			var procs=eval("("+datas["node.procs"]+")");
			var clientTimestamp=datas["clientTimestamp"];
			var proc=procs[pid];
			if (true!=forceUpdate) {
				//only update when there is an update data
				if (this.lastClientTimestamp>-1) {
					if (clientTimestamp<=this.lastClientTimestamp) {
						return;
					}
				}
			}
			
			this.lastClientTimestamp=clientTimestamp;
			var procInfo = proc["tags"];
			
			//cpu
			var cpuRate=procInfo["cpu"];
github uavorg / uavstack / com.creditease.uav.console / src / main / webapp / uavapp_godeye / uavnetwork / js / uav.network.js View on Github external
buildProcessChartContent : function(resultObj,pid){
			var procs=eval("("+resultObj["node.procs"]+")");
			var proc=procs[pid];
			
			if (proc==undefined) {
				alert("进程号["+pid+"]的进程在["+resultObj["ip"]+"]不存在!")
				return;
			}
			
			var ports=proc["ports"];
			var connSeries=[
	        	{
		        	name:"进程连接数",
		        	color:"#EEEE00",
		        	data:[]
	        	}
	   		];
	   		var fluxSeries=[
github uavorg / uavstack / com.creditease.uav.console / src / main / webapp / uavapp_godeye / uavnetwork / js / uav.network.js View on Github external
updateNodeBox :  function(jsonObj){
	        
	        if(HtmlHelper.id(jsonObj.id)==undefined){
	           this.addNodeBox(jsonObj);
	           return;
	        };

	        var procState = '';
	    	if(jsonObj['node.pid']){
	    		var procs;
	    		if(jsonObj['node.procs']){
	    			procs = eval("("+jsonObj['node.procs']+")");
	    		}else{
	    			var macinfo=app.mdata("macinfo");
	    			var node=macinfo[jsonObj["ip"]];
	    			var procsStr='{}';
	    			if(node){
	    				procsStr=node["node.procs"];
	    			}
	    			if (procsStr) {
	    				procs = eval("("+procsStr+")");
	    			}
	    		}
	    		if (procs) {
	    			procState = this.buildProcStateHtm(procs[jsonObj['node.pid']]);
	    		}
	    	}
github uavorg / uavstack / com.creditease.uav.console / src / main / webapp / uavapp_godeye / uavnetwork / js / uav.network.js View on Github external
"                  <span class="\&quot;kvField\&quot;">Http服务</span><span>:</span>"+this.formatter.services(jsonObj["node.services"]) +
	            "              " +
	            "                <div class="\&quot;kv\&quot;">" +
	            "                    <span class="\&quot;kvField\&quot;">所属心跳地址</span><span>:</span>"+jsonObj["node.hbserver"] +
	            "                </div>" +
	            "                <div class="\&quot;kv\&quot;">" +
	            "                    <span class="\&quot;kvField\&quot;">路径</span><span>:</span>"+jsonObj["node.root"] +
	            "                </div>" +
		    "                <div class="\&quot;kv\&quot;">" +
                    "                    <span class="\&quot;kvField\&quot;">版本</span><span>:</span>"+jsonObj["node.version"] +
                    "                </div>" +
	            "                <div class="\&quot;kv\&quot;">" +
	            "                    <span class="\&quot;kvField\&quot;">端口</span><span>:</span>";
			
				var macinfo=app.mdata("macinfo");
				var procs=eval("("+macinfo[jsonObj["ip"]]["node.procs"]+")");
				var pid=jsonObj["node.pid"];
				for (var key in procs) {
					
					if (pid==key) {
						str+=procs[key]["ports"];
						break;
					}					
				}
	            str+="</div>";
	            
	            /**
	             * build control panel
	             */
	            str+="<div class="\&quot;kv\&quot;">"+this.buildNodeCtrlPanel(jsonObj)+"</div>";
	            
	            return str;
github uavorg / uavstack / com.creditease.uav.console / src / main / webapp / uavapp_godeye / uavnetwork / js / uav.network.js View on Github external
update:function(oldObj,newObj) {
	        	        	  
	        	        	  
	        	        	  var np=newObj["node.procs"];
	        	        	  var op=oldObj["node.procs"];
	        	        	  var ot=oldObj["clientTimestamp"];
	        	        	  var nt=newObj["clientTimestamp"];
	        	        	  
        	        		  if (this.timestamp==0) {
        	        			  this.timestamp=ot;
        	        		  }
        	        		  
	        	        	  if(op==undefined) {
	        	        		  this.timestamp=nt;
	        	        		  return np;
	        	        	  }
	        	        	  
	        	        	  if (nt-ot>0&&np!=undefined) {
	        	        		  this.timestamp=nt;
	        	        		  return np;	        	        		  
	        	        	  }
github uavorg / uavstack / com.creditease.uav.console / src / main / webapp / uavapp_godeye / uavnetwork / js / uav.network.js View on Github external
update:function(oldObj,newObj) {
	        	        	  
	        	        	  
	        	        	  var np=newObj["node.procs"];
	        	        	  var op=oldObj["node.procs"];
	        	        	  var ot=oldObj["clientTimestamp"];
	        	        	  var nt=newObj["clientTimestamp"];
	        	        	  
        	        		  if (this.timestamp==0) {
        	        			  this.timestamp=ot;
        	        		  }
        	        		  
	        	        	  if(op==undefined) {
	        	        		  this.timestamp=nt;
	        	        		  return np;
	        	        	  }
	        	        	  
	        	        	  if (nt-ot>0&&np!=undefined) {
	        	        		  this.timestamp=nt;
	        	        		  return np;
github uavorg / uavstack / com.creditease.uav.console / src / main / webapp / uavapp_godeye / uavnetwork / js / uav.network.js View on Github external
//node info		
			var nodes=app.mdata("nodeinfo");
			//the monitoragent node info
			var maNodeInfo;
			for (var nodeKey in nodes) {
				var nodeObj=nodes[nodeKey];
				if (nodeObj["ip"]==ip) {
					divContent+=this.buildMacDetailNodeInfo(nodeObj);
					
					if (nodeObj["node.profile"].indexOf("ma")==0||nodeObj["name"]=="监控代理程序") {
						maNodeInfo=nodeObj;
					}
				}
			}
			//process info
			var procs=eval("("+dObj["node.procs"]+")");
			
			var handler=function(proc) {
				//we should deliver the maNodeInfo to the process info panel as we need ctrl the process via MonitorAgent
				divContent+=app.controller.buildMacProcessInfo(proc,maNodeInfo);
			};
			
			this.handleProcess(procs,handler);

			divContent+=this.buildMacDetailEndContent();
	        return divContent;
		},
		//Ultron container only