"use strict";(function(){var i=0;"use strict";var e=require("util");var n=require("events");function t(e,n,t){if(i){console.log(e,"---------"+n)}}var s=null;var r=null;var a=1;function l(i,e,t){n.EventEmitter.call(this);if(false===this instanceof l){return new l}var a=this;a.diag=i;s=e;r=t;a.dhcp_server_addrs=[]}e.inherits(l,n.EventEmitter);l.prototype.getCpuInfo=function(i){var e=this;var n={};e.diag._execCmdSimple("show cpu",function(e){t(e,"haha");var s=/CPU utilization in five seconds\s*:\s+(\S+)/gim;var r=s.exec(e);if(r!=null){n.five_sec=r[1]}s=/CPU utilization in one minute\s*:\s+(\S+)/gim;r=s.exec(e);if(r!=null){n.one_min=r[1]}s=/CPU utilization in five minutes\s*:\s+(\S+)/gim;r=s.exec(e);if(r!=null){n.five_min=r[1]}var l=e.split(/\r?\n/gi);var u=false;n.process=[];for(var o=a;o<l.length;o++){var v=l[o].trim().split(/\s+/);if(v.length!=5||v[0]=="NO"||v[4]=="idle"){continue}if(parseInt(v[1].split("%")[0])>=20){n.process.push(v)}}i(n)})};module.exports=l})();