public function get_content() { $server = Cache::load($this, 3600 * 24); echo <<<EOD <strong>Ip Address</strong> {$server['ip']}<br> <strong>CPU</strong> {$server['cpu']}<br> <strong>Number of Core</strong> {$server['core']}<br> <strong>Ram</strong> {$server['ram']}<br> <strong>Hostname</strong> {$server['hostname']}<br> <strong>OS</strong> {$server['os']}<br> <strong>Uptime</strong> {$server['uptime']}<br> EOD; }
public function get_content() { $processes = $this->get_metric(); $processes = Cache::load($this, 180); //3 minutes $html = '<table class="wp-list-table widefat"><thead><tr> <th>User</th> <th>Pid</th> <th>%CPU</th> <th>%Mem</th> <th>Command</th> </tr></thead><tbody>'; foreach ($processes as $process) { $html .= "<tr>\n <td>{$process['user']}</td>\n <td>{$process['pid']}</td>\n <td>{$process['%cpu']}</td>\n <td>{$process['%mem']}</td>\n <td>{$process['command']}</td>\n </tr>"; } $html .= '</tbody></table>'; echo $html; }