From 348e6835a20657d3dbc0909a026dad8c85fcc2eb Mon Sep 17 00:00:00 2001 From: zhouxin Date: Thu, 12 Sep 2024 09:16:31 +0800 Subject: [PATCH] * [misc] move metrics for internel use to zentaomisc. --- module/bi/config/metrics.php | 28 --------- ...rom_current_execution_bug_in_execution.php | 53 ---------------- ...k_from_past_execution_bug_in_execution.php | 60 ------------------- 3 files changed, 141 deletions(-) delete mode 100644 module/metric/calc/execution/hour/consumed_of_task_from_current_execution_bug_in_execution.php delete mode 100644 module/metric/calc/execution/hour/consumed_of_task_from_past_execution_bug_in_execution.php diff --git a/module/bi/config/metrics.php b/module/bi/config/metrics.php index 2535b8ac47..33edd2f6e6 100644 --- a/module/bi/config/metrics.php +++ b/module/bi/config/metrics.php @@ -4494,31 +4494,3 @@ $config->bi->builtin->metrics[] = array 'desc' => '按执行统计的执行开发效率是指执行交付研发需求规模数与执行所有任务消耗工时的比率。该度量项反映了执行的开发速度,可以帮助团队识别潜在问题并采取改进措施提高研发效率。', 'definition' => "复用:按执行统计的任务消耗工时数、按执行统计的执行关闭时已交付的研发需求规模数;\n公式:按执行统计的执行关闭时已交付的研发需求规模数/按执行统计的任务消耗工时数" ); - -$config->bi->builtin->metrics[] = array -( - 'name' => '按执行统计的当期Bug转任务的任务消耗工时', - 'alias' => '当期Bug转任务的任务消耗工时数', - 'code' => 'consumed_of_task_from_current_execution_bug_in_execution', - 'purpose' => 'hour', - 'scope' => 'execution', - 'object' => 'task', - 'unit' => 'hour', - 'dateType' => 'nodate', - 'desc' => '按执行统计的往期Bug转任务的任务消耗工时数是指执行中当期产生的Bug转任务消耗的工时总和。该度量项反映了任务来源为当期Bug的资源使用情况,可以帮助团队识别当期产生的缺陷占用的团队资源以及缺陷管理中存在的问题。', - 'definition' => "执行中满足以下条件的任务消耗工时数求和,条件是:\n任务来源为当期Bug,过滤已删除的任务,过滤父任务,过滤已删除的执行,过滤已删除的项目。\n当期Bug的定义:Bug的影响版本是执行中创建的版本。" -); - -$config->bi->builtin->metrics[] = array -( - 'name' => '按执行统计的往期Bug转任务的任务消耗工时', - 'alias' => '往期Bug转任务的任务消耗工时数', - 'code' => 'consumed_of_task_from_past_execution_bug_in_execution', - 'purpose' => 'hour', - 'scope' => 'execution', - 'object' => 'task', - 'unit' => 'hour', - 'dateType' => 'nodate', - 'desc' => '按执行统计的往期Bug转任务的任务消耗工时数是指执行中由往期Bug转任务消耗的工时总和。该度量项反映了任务来源为往期Bug的资源使用情况,可以帮助团队识别历史遗留缺陷占用的团队资源以及缺陷管理中存在的问题。', - 'definition' => "执行中满足以下条件的任务消耗工时数求和,条件是:\n任务来源为往期Bug,过滤已删除的任务,过滤父任务,过滤已删除的执行,过滤已删除的项目。\n往期Bug的定义:Bug的影响版本不是本期迭代中的版本。" -); diff --git a/module/metric/calc/execution/hour/consumed_of_task_from_current_execution_bug_in_execution.php b/module/metric/calc/execution/hour/consumed_of_task_from_current_execution_bug_in_execution.php deleted file mode 100644 index 1f7c350253..0000000000 --- a/module/metric/calc/execution/hour/consumed_of_task_from_current_execution_bug_in_execution.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @package - * @uses func - * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html) - * @Link https://www.zentao.net - */ -class consumed_of_task_from_current_execution_bug_in_execution extends baseCalc -{ - public $result = array(); - - public $dataset = 'getTasksWithBuildInfo'; - - public $fieldList = array('t1.id as taskID', 't1.execution', 't1.consumed', 't2.openedBuild', 't5.id as currentBuild'); - - public function calculate($row) - { - if(!isset($this->result[$row->execution])) - { - $this->result[$row->execution] = array(); - $this->result[$row->execution]['consumed'] = 0; - $this->result[$row->execution]['taskList'] = array(); - } - - $openedBuildList = explode(',', $row->openedBuild); - if(!in_array($row->taskID, $this->result[$row->execution]['taskList']) && in_array($row->currentBuild, $openedBuildList)) - { - $this->result[$row->execution]['taskList'][] = $row->taskID; - $this->result[$row->execution]['consumed'] += $row->consumed; - } - } - - public function getResult($options = array()) - { - $records = array(); - foreach($this->result as $execution => $executionData) $records[] = array('execution' => $execution, 'value' => $executionData['consumed']); - - return $this->filterByOptions($records, $options); - } -} diff --git a/module/metric/calc/execution/hour/consumed_of_task_from_past_execution_bug_in_execution.php b/module/metric/calc/execution/hour/consumed_of_task_from_past_execution_bug_in_execution.php deleted file mode 100644 index abc2f5a9fe..0000000000 --- a/module/metric/calc/execution/hour/consumed_of_task_from_past_execution_bug_in_execution.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @package - * @uses func - * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html) - * @Link https://www.zentao.net - */ -class consumed_of_task_from_past_execution_bug_in_execution extends baseCalc -{ - public $result = array(); - - public $dataset = 'getTasksWithBuildInfo'; - - public $fieldList = array('t1.id as taskID', 't1.execution', 't1.consumed', 't2.openedBuild', 't5.id as currentBuild'); - - public function calculate($row) - { - if(!isset($this->result[$row->execution])) - { - $this->result[$row->execution] = array(); - $this->result[$row->execution]['taskList'] = array(); - $this->result[$row->execution]['consumed'] = 0; - } - - $openedBuildList = explode(',', $row->openedBuild); - if(!in_array($row->currentBuild, $openedBuildList) && !in_array($row->taskID, $this->result[$row->execution]['taskList'])) - { - $this->result[$row->execution]['taskList'][] = $row->taskID; - $this->result[$row->execution]['consumed'] += $row->consumed; - } - - if(in_array($row->currentBuild, $openedBuildList) && in_array($row->taskID, $this->result[$row->execution]['taskList'])) - { - $index = array_search($row->taskID, $this->result[$row->execution]['taskList']); - unset($this->result[$row->execution]['taskList'][$index]); - $this->result[$row->execution]['consumed'] -= $row->consumed; - } - } - - public function getResult($options = array()) - { - $records = array(); - foreach($this->result as $execution => $executionData) $records[] = array('execution' => $execution, 'value' => $executionData['consumed']); - - return $this->filterByOptions($records, $options); - } -}