From f7d0ef12c7bfc91d3fdcba8eb003cf729566919a Mon Sep 17 00:00:00 2001 From: wangzemei Date: Tue, 17 Jun 2025 13:15:03 +0800 Subject: [PATCH] + [task#145347] add the consume_of_task_in_type_in_execution metric. --- .../consume_of_task_in_type_in_execution.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/module/metric/calc/execution/hour/consume_of_task_in_type_in_execution.php b/module/metric/calc/execution/hour/consume_of_task_in_type_in_execution.php index cb98b14aca..f936475ab1 100755 --- a/module/metric/calc/execution/hour/consume_of_task_in_type_in_execution.php +++ b/module/metric/calc/execution/hour/consume_of_task_in_type_in_execution.php @@ -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); + } }