_kstat('unix:0:system_misc:avenrun_1min'); return array('loadavg' => $load1); } /** * Checks whether class is supported in this environment * * @return true on success */ public function supported() { return @is_readable('/proc/meminfo'); } /** * Gets information about memory usage * * @return array with memory usage data */ public function memory() { $pagesize = $this->_kstat('unix:0:seg_cache:slab_size'); $mem = array(); $mem['MemTotal'] = $this->_kstat('unix:0:system_pages:pagestotal') * $pagesize; $mem['MemUsed'] = $this->_kstat('unix:0:system_pages:pageslocked') * $pagesize; $mem['MemFree'] = $this->_kstat('unix:0:system_pages:pagesfree') * $pagesize; $mem['SwapTotal'] = $this->_kstat('unix:0:vminfo:swap_avail') / 1024; $mem['SwapUsed'] = $this->_kstat('unix:0:vminfo:swap_alloc') / 1024; $mem['SwapFree'] = $this->_kstat('unix:0:vminfo:swap_free') / 1024; return $mem; } }