+ [task#145347] add the consume_of_task_in_type_in_execution metric.
This commit is contained in:
@@ -15,4 +15,20 @@ class consume_of_task_in_type_in_execution extends baseCalc
|
||||
if(!isset($this->result[$row->type])) $this->result[$row->type] = array();
|
||||
$this->result[$row->type][$row->id] = $row->consumed;
|
||||
}
|
||||
|
||||
public function getResult($options = array())
|
||||
{
|
||||
foreach($this->result as $type => $tasks)
|
||||
{
|
||||
if(!is_array($tasks))
|
||||
{
|
||||
unset($this->result[$type]);
|
||||
continue;
|
||||
}
|
||||
$this->result[$type] = array_sum($tasks);
|
||||
}
|
||||
|
||||
$records = $this->getRecords(array('type', 'value'));
|
||||
return $this->filterByOptions($records, $options);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user