* measurement: finish task #97992.

This commit is contained in:
zhouxin
2023-07-21 15:01:24 +08:00
parent a5828b0cb2
commit 4dbce4ecc0
@@ -10,15 +10,15 @@
* 单位:%
* 描述:按全局统计的研发需求交付率表示按全局统计的已交付的研发需求数相对于按全局统计的有效研发需求数。这个度量项衡量了研发团队按时交付需求的能力。交付率越高,代表研发团队能够按时将需求交付给其他团队,实现产品的正常发布。
* 定义:复用:
按全局统计的已交付研发需求数
按全局统计的有效研发需求数
公式:
按产品统计的研发需求完成率=按产品统计的已交付研发需求数/按产品统计的有效研发需求数*100%
* 按全局统计的已交付研发需求数
* 按全局统计的有效研发需求数
* 公式:
* 按产品统计的研发需求完成率=按产品统计的已交付研发需求数/按产品统计的有效研发需求数*100%
* 度量库:
* 收集方式:realtime
*
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
* @author qixinzhi <qixinzhi@easycorp.ltd>
* @author zhouxin <zhouxin@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)
@@ -26,20 +26,24 @@
*/
class rate_of_delivered_story extends baseCalc
{
public $dataset = null;
public $dataset = 'getDevStories';
public $fieldList = array();
public $fieldList = array('t1.closedReason', 't1.stage');
//public funtion getStatement($dao)
//{
//}
public function calculate($data)
public function calculate($row)
{
if(!isset($this->result['finished'])) $this->result['finished'] = 0;
if(!isset($this->result['valid'])) $this->result['valid'] = 0;
if($row->stage == 'released' || $row->closedReason == 'done') $this->result['delivered'] ++;
if(!in_array($row->closedReason, array('duplicate', 'willnotdo', 'bydesign', 'cancel'))) $this->result['valid'] ++;
}
public function getResult($options = array())
{
return $this->filterByOptions($this->result, $options);
$this->result = $this->result['valid'] ? round($this->result['delivered'] / $this->result['valid'], 4) : 0;
$records = array(array('value' => $this->result));
return $this->filterByOptions($records, $options);
}
}
}