Added GPU stats
This commit is contained in:
@@ -14,6 +14,36 @@ class CrashStats
|
|||||||
$this->filter = $filter;
|
$this->filter = $filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getGPUStats()
|
||||||
|
{
|
||||||
|
$ret = array();
|
||||||
|
$where = $this->filter->getWhere();
|
||||||
|
if ($where)
|
||||||
|
{
|
||||||
|
$where .= " and ";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$where = "where ";
|
||||||
|
}
|
||||||
|
$where .= "gpu is not null";
|
||||||
|
$q = "select count(id) as nr, gpu from reports $where group by gpu order by nr desc";
|
||||||
|
$q .= kl_str_sql(" limit !i", $this->filter->limit);
|
||||||
|
if (false !== $cached = Memc::getq($q)) return $cached;
|
||||||
|
|
||||||
|
if (!$res = DBH::$db->query($q)) return $ret;
|
||||||
|
|
||||||
|
while ($row = DBH::$db->fetchRow($res))
|
||||||
|
{
|
||||||
|
$o = new stdClass;
|
||||||
|
DBH::$db->loadFromDbRow($o, $res, $row);
|
||||||
|
$ret[] = $o;
|
||||||
|
}
|
||||||
|
|
||||||
|
Memc::setq($q, $ret);
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
|
|
||||||
function getOSStats()
|
function getOSStats()
|
||||||
{
|
{
|
||||||
$ret = array();
|
$ret = array();
|
||||||
|
|||||||
@@ -28,12 +28,37 @@ $filter->render();
|
|||||||
|
|
||||||
<!-- top crashers tab -->
|
<!-- top crashers tab -->
|
||||||
<div id="tab-1">
|
<div id="tab-1">
|
||||||
|
<p>Working on it</p>
|
||||||
</div>
|
</div>
|
||||||
<!-- /top crashers tab -->
|
<!-- /top crashers tab -->
|
||||||
|
|
||||||
|
|
||||||
<!-- gpu tab -->
|
<!-- gpu tab -->
|
||||||
<div id="tab-2">
|
<div id="tab-2">
|
||||||
|
<?php
|
||||||
|
function rl_g($r)
|
||||||
|
{
|
||||||
|
global $filter;
|
||||||
|
return URL_ROOT . "/crashes.php?" . $filter->getURLArgs() . "&gpu=" . urlencode($r->gpu);
|
||||||
|
}
|
||||||
|
$gpus = $stats->getGPUStats();
|
||||||
|
$c = count($gpus);
|
||||||
|
if ($c) :
|
||||||
|
?>
|
||||||
|
<table class="jtable">
|
||||||
|
<tr>
|
||||||
|
<th>Nr. reports</th>
|
||||||
|
<th>GPU Identifier</th>
|
||||||
|
</tr>
|
||||||
|
<?php foreach($gpus as $r): ?>
|
||||||
|
<tr class="rowhighlight">
|
||||||
|
<td style="text-align: right"><a href="<?php echo rl_g($r) ?>"><?php echo htmlentities($r->nr) ?></a></td>
|
||||||
|
<td><a href="<?php echo rl_g($r) ?>"><?php echo htmlentities($r->gpu) ?></a></td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<?php endif ?>
|
||||||
</div>
|
</div>
|
||||||
<!-- /gpu tab -->
|
<!-- /gpu tab -->
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user