31 lines
900 B
PHP
31 lines
900 B
PHP
<?php
|
|
class Myqueue extends MY_Controller
|
|
{
|
|
function __construct() {
|
|
parent::__construct();
|
|
$this->db = $this->load->database("onedev", true);
|
|
}
|
|
function list($time=0) {
|
|
$sql = "select ID,USER,HOST,DB,COMMAND,TIME,STATE,PROGRESS,MEMORY_USED
|
|
from INFORMATION_SCHEMA.processlist
|
|
where USER <> 'system user' and TIME >= $time";
|
|
$qry = $this->db->query($sql);
|
|
//echo $this->db->last_query();
|
|
if (! $qry ) {
|
|
print_r($this->db->error());
|
|
exit;
|
|
}
|
|
$rows = $qry->result_array();
|
|
echo "ID\t\tUSER\t\tDB\t\tTIME\t\tMEMORY_USED\t\tPROGRESS\n";
|
|
foreach($rows as $r) {
|
|
$id = $r["ID"];
|
|
$user = $r["USER"];
|
|
$db = $r["DB"];
|
|
$time = $r["TIME"];
|
|
$mem = $r["MEMORY_USED"];
|
|
$progress = $r["PROGRESS"];
|
|
echo "$id\t\t$user\t\t$db\t\t$time\t\t$mem\t\t$progress\n";
|
|
}
|
|
}
|
|
}
|