Skip to content

Commit

Permalink
webui: update analytics model
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergkemper committed Mar 10, 2022
1 parent 5853baf commit da98f76
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion webui/module/Analytics/src/Analytics/Model/AnalyticsModel.php
Expand Up @@ -27,4 +27,31 @@

class AnalyticsModel
{
}
public function getJobTotals(&$bsock=null)
{
if(isset($bsock)) {
$cmd = 'list jobtotals';
$result = $bsock->send_command($cmd, 2);
$jobtotals = \Zend\Json\Json::decode($result, \Zend\Json\Json::TYPE_ARRAY);
$children = array("children" => $jobtotals['result']['jobs']);
return $children;
}
else {
throw new \Exception('Missing argument.');
}
}

public function getOverallJobTotals(&$bsock=null)
{
if(isset($bsock)) {
$cmd = 'list jobtotals';
$result = $bsock->send_command($cmd, 2);
$jobtotals = \Zend\Json\Json::decode($result, \Zend\Json\Json::TYPE_ARRAY);
$result = $jobtotals['result']['jobtotals'];
return $result;
}
else {
throw new \Exception('Missing argument.');
}
}
}

0 comments on commit da98f76

Please sign in to comment.