Added operating system stats
This commit is contained in:
@@ -13,6 +13,36 @@ class CrashStats
|
||||
{
|
||||
$this->filter = $filter;
|
||||
}
|
||||
|
||||
function getOSStats()
|
||||
{
|
||||
$ret = array();
|
||||
$where = $this->filter->getWhere();
|
||||
if ($where)
|
||||
{
|
||||
$where .= " and ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$where = "where ";
|
||||
}
|
||||
$where .= "os_type is not null";
|
||||
$q = "select count(id) as nr, os_type from reports $where group by os_type 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 getRegionStats()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user