+ [task#145347] add the consume_of_task_in_type_in_execution metric.

This commit is contained in:
wangzemei
2025-06-17 13:18:03 +08:00
parent ec7060e4cf
commit f7d0ef12c7
@@ -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);
}
}