* Update metric defination from master branch.

This commit is contained in:
qixinzhi
2024-01-22 15:09:16 +08:00
parent d83701ef9c
commit aa5e5ac37f
8 changed files with 102 additions and 26 deletions
@@ -44,20 +44,7 @@ class count_of_daily_resolved_bug_in_product extends baseCalc
public function getResult($options = array())
{
$records = array();
foreach($this->result as $product => $years)
{
foreach($years as $year => $months)
{
foreach($months as $month => $days)
{
foreach($days as $day => $value)
{
$records[] = array('product' => $product, 'year' => $year, 'month' => $month, 'day' => $day, 'value' => $value);
}
}
}
}
$records = $this->getRecords(array('product', 'year', 'month', 'day', 'value'));
return $this->filterByOptions($records, $options);
}
@@ -52,3 +52,4 @@ class left_period_of_project extends baseCalc
return $this->filterByOptions($records, $options);
}
}
@@ -8,7 +8,7 @@
* 目的:scale
* 度量名称:按系统统计的年度关闭执行数
* 单位:个
* 描述:按系统统计的年度完成执行数是指在某年度已经关闭的执行数。该度量项反映了团队或组织在某年的工作效率和完成能力。较高的年度完成执行数表示团队或组织在完成任务方面表现出较高的效率,反之则可能需要审查工作流程和资源分配情况,以提高执行效率。
* 描述:按系统统计的年度关闭执行数是指在关闭时间在某年的执行数。该度量项可以反映团队或组织在某年的工作效率。较高的年度关闭执行数可能表示团队或组织在完成任务方面表现出较高的效率,反之则可能需要审查工作流程和资源分配情况,以提高执行效率。
* 定义:所有的执行个数求和;关闭时间为某年;过滤已删除的执行;
*
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
@@ -0,0 +1,46 @@
<?php
/**
* 按系统统计的年度完成执行数。
* Count of annual finished execution.
*
* 范围:system
* 对象:execution
* 目的:scale
* 度量名称:按系统统计的年度完成执行数
* 单位:个
* 描述:按系统统计的年度完成执行数是指在某年度已经完成的执行数。该度量项反映了团队或组织在某年的工作效率和完成能力。较高的年度完成执行数表示团队或组织在完成任务方面表现出较高的效率,反之则可能需要审查工作流程和资源分配情况,以提高执行效率。
* 定义:所有的执行个数求和;实际完成日期为某年;过滤已删除的执行;
*
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
* @author qixinzhi <qixinzhi@easycorp.ltd>
* @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 count_of_annual_finished_execution extends baseCalc
{
public $dataset = 'getExecutions';
public $fieldList = array('t1.closedDate');
public $result = array();
public function calculate($row)
{
$closedDate = $row->closedDate;
if(empty($closedDate)) return false;
$year = substr($closedDate, 0, 4);
if($year == '0000') return false;
if(!isset($this->result[$year])) $this->result[$year] = 0;
$this->result[$year] += 1;
}
public function getResult($options = array())
{
$records = $this->getRecords(array('year', 'value'));
return $this->filterByOptions($records, $options);
}
}
@@ -45,14 +45,7 @@ class count_of_monthly_created_release extends baseCalc
public function getResult($options = array())
{
$records = array();
foreach($this->result as $year => $months)
{
foreach($months as $month => $value)
{
$records[] = array('year' => $year, 'month' => $month, 'value' => $value);
}
}
$records = $this->getRecords(array('year', 'month', 'value'));
return $this->filterByOptions($records, $options);
}
}
@@ -9,7 +9,7 @@
* 度量名称:按人员统计的待处理Bug数
* 单位:个
* 描述:按人员统计的待处理Bug数表示每个人待处理的Bug数量之和。反映了每个人需要处理的Bug数量上的规模。该数值越大,说明需要投入越多的时间解决Bug。
* 定义:所有Bug个数求和;指派给为某人;过滤状态为已关闭的Bug;过滤已删除的Bug;过滤已删除产品的Bug;
* 定义:所有Bug个数求和 指派给为某人 过滤已删除的Bug 过滤已关闭的Bug 过滤已删除产品的Bug 不过滤影子产品;
*
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
* @author zhouxin <zhouxin@easycorp.ltd>
@@ -20,7 +20,7 @@
*/
class count_of_assigned_bug_in_user extends baseCalc
{
public $dataset = 'getBugs';
public $dataset = 'getBugsWithShadowProduct';
public $fieldList = array('t1.assignedTo');
@@ -37,7 +37,7 @@ class count_of_assigned_task_in_user extends baseCalc
if(empty($assignedTo) || $assignedTo == 'closed') return false;
if($status == 'closed' || $status == 'cancel') return false;
if($projectStatus == 'suspended' || $executionStatus == 'suspended') return false;
if($projectStatus == 'suspended' || $projectStatus == 'closed' || $executionStatus == 'suspended' || $executionStatus == 'closed') return false;
if($mode == 'multi')
{
@@ -0,0 +1,49 @@
<?php
/**
* 按人员统计的延期任务数。
* Count of delayed task in user.
*
* 范围:user
* 对象:task
* 目的:scale
* 度量名称:按人员统计的延期任务数
* 单位:个
* 描述:按人员统计的延期任务数是指每个人延期任务总量。该度量项可以用来评估每个人的工作效率和完成能力。
* 定义:截止当前时间;统计每个人延期任务数的求和;过滤已删除的任务;
* 度量库:
* 收集方式:realtime
*
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
* @author qixinzhi <qixinzhi@easycorp.ltd>
* @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 count_of_delayed_task_in_user extends baseCalc
{
public $dataset = 'getTasks';
public $fieldList = array('t1.assignedTo', 't1.deadline');
public $result = array();
public function calculate($row)
{
$nowDate = helper::now();
$deadline = $row->deadline;
$assignedTo = $row->assignedTo;
if(empty($deadline) || substr($deadline, 0 ,4) == '0000') return false;
if(strtotime($nowDate) <= strtotime($deadline)) return false;
if(!isset($this->result[$assignedTo])) $this->result[$assignedTo] = 0;
$this->result[$assignedTo] += 1;
}
public function getResult($options = array())
{
$records = $this->getRecords(array('user', 'value'));
return $this->filterByOptions($records, $options);
}
}