*[misc] modify execution metric like starting closing.

This commit is contained in:
songchenxuan
2024-08-14 11:20:01 +08:00
committed by 周鑫
parent 583b79903b
commit f404e150a7
12 changed files with 70 additions and 8 deletions
@@ -45,9 +45,10 @@ class rate_of_verified_story_in_execution_when_closing extends baseCalc
$executions = array_column($all, 'execution', 'execution');
foreach($executions as $execution)
{
$verifiedStory = isset($verifiedStories[$execution]) ? $verifiedStories[$execution] : 0;
$validStory = isset($validStories[$execution]) ? $validStories[$execution] : 0;
if(!isset($verifiedStories[$execution])) continue;
$verifiedStory = $verifiedStories[$execution];
$validStory = isset($validStories[$execution]) ? $validStories[$execution] : 0;
$this->result[$execution] = $validStory == 0 ? 0 : round($verifiedStory / $validStory, 4);
}
}
@@ -44,9 +44,10 @@ class test_concentration_in_execution_when_closing extends baseCalc
$executions = array_column($all, 'execution', 'execution');
foreach($executions as $execution)
{
$bug = isset($bugs[$execution]) ? $bugs[$execution] : 0;
$story = isset($stories[$execution]) ? $stories[$execution] : 0;
if(!isset($stories[$execution])) continue;
$bug = isset($bugs[$execution]) ? $bugs[$execution] : 0;
$story = $stories[$execution];
$this->result[$execution] = $story == 0 ? 0 : round($bug / $story, 4);
}
}
@@ -22,6 +22,8 @@ class devel_efficiency_in_execution_when_closing extends baseCalc
{
public $result = array();
public $initRecord = false;
public $reuse = true;
public $reuseMetrics = array('storyScale' => 'scale_of_delivered_story_in_execution_when_closing', 'taskConsumed' => 'consume_of_task_in_execution');
@@ -41,9 +43,10 @@ class devel_efficiency_in_execution_when_closing extends baseCalc
$executions = array_column($all, 'execution', 'execution');
foreach($executions as $execution)
{
$storyScaleItem = isset($storyScale[$execution]) ? $storyScale[$execution] : 0;
$taskConsumedItem = isset($taskConsumed[$execution]) ? $taskConsumed[$execution] : 0;
if(!isset($storyScale[$execution])) continue;
$storyScaleItem = $storyScale[$execution];
$taskConsumedItem = isset($taskConsumed[$execution]) ? $taskConsumed[$execution] : 0;
$this->result[$execution] = $taskConsumedItem == 0 ? 0 : round($storyScaleItem / $taskConsumedItem, 4);
}
}
@@ -41,6 +41,13 @@ class rate_of_finished_test_task_in_execution_when_closing extends baseCalc
public function getResult($options = array())
{
$records = array();
$executions = $this->getExecutions();
$closedExecutions = array_filter($executions, function($execution) { return $execution->status === 'closed'; });
foreach($closedExecutions as $executionID => $executionInfo)
{
if(!isset($this->result[$executionID])) $this->result[$executionID] = array('finished' => 0, 'total' => 0);
}
foreach($this->result as $execution => $value)
{
$rate = $value['total'] == 0 ? 0 : round($value['finished'] / $value['total'], 4);
@@ -44,9 +44,10 @@ class rate_of_planned_developed_story_in_execution_when_closing extends baseCalc
$executions = array_column($all, 'execution', 'execution');
foreach($executions as $execution)
{
$finish = isset($storyFinish[$execution]) ? $storyFinish[$execution] : 0;
$link = isset($storyLink[$execution]) ? $storyLink[$execution] : 0;
if(!isset($storyFinish[$execution])) continue;
$finish = $storyFinish[$execution];
$link = isset($storyLink[$execution]) ? $storyLink[$execution] : 0;
$this->result[$execution] = $link == 0 ? 0 : round($finish / $link, 4);
}
}
@@ -44,6 +44,13 @@ class count_of_delivered_story_in_execution_when_closing extends baseCalc
public function getResult($options = array())
{
$executions = $this->getExecutions();
$closedExecutions = array_filter($executions, function($execution) { return $execution->status === 'closed'; });
foreach($closedExecutions as $executionID => $executionInfo)
{
if(!isset($this->result[$executionID])) $this->result[$executionID] = 0;
}
$records = $this->getRecords(array('execution', 'value'));
return $this->filterByOptions($records, $options);
}
@@ -39,6 +39,13 @@ class count_of_finished_test_task_in_execution_when_closing extends baseCalc
public function getResult($options = array())
{
$executions = $this->getExecutions();
$closedExecutions = array_filter($executions, function($execution) { return $execution->status === 'closed'; });
foreach($closedExecutions as $executionID => $executionInfo)
{
if(!isset($this->result[$executionID])) $this->result[$executionID] = 0;
}
$records = $this->getRecords(array('execution', 'value'));
return $this->filterByOptions($records, $options);
}
@@ -60,6 +60,13 @@ class count_of_story_in_execution_when_starting extends baseCalc
$this->result[$execution] += 1;
}
$executions = $this->getExecutions();
$beginExecutions = array_filter($executions, function($execution) { return !empty($execution->realBegan); });
foreach($beginExecutions as $executionID => $executionInfo)
{
if(!isset($this->result[$executionID])) $this->result[$executionID] = 0;
}
$records = $this->getRecords(array('execution', 'value'));
return $this->filterByOptions($records, $options);
}
@@ -39,6 +39,13 @@ class count_of_test_task_in_execution_when_starting extends baseCalc
public function getResult($options = array())
{
$executions = $this->getExecutions();
$beginExecutions = array_filter($executions, function($execution) { return !empty($execution->realBegan); });
foreach($beginExecutions as $executionID => $executionInfo)
{
if(!isset($this->result[$executionID])) $this->result[$executionID] = 0;
}
$records = $this->getRecords(array('execution', 'value'));
return $this->filterByOptions($records, $options);
}
@@ -47,6 +47,13 @@ class count_of_verified_story_in_execution_when_closing extends baseCalc
public function getResult($options = array())
{
$executions = $this->getExecutions();
$closedExecutions = array_filter($executions, function($execution) { return $execution->status === 'closed'; });
foreach($closedExecutions as $executionID => $executionInfo)
{
if(!isset($this->result[$executionID])) $this->result[$executionID] = 0;
}
$records = $this->getRecords(array('execution', 'value'));
return $this->filterByOptions($records, $options);
}
@@ -44,6 +44,13 @@ class scale_of_delivered_story_in_execution_when_closing extends baseCalc
public function getResult($options = array())
{
$executions = $this->getExecutions();
$closedExecutions = array_filter($executions, function($execution) { return $execution->status === 'closed'; });
foreach($closedExecutions as $executionID => $executionInfo)
{
if(!isset($this->result[$executionID])) $this->result[$executionID] = 0;
}
$records = $this->getRecords(array('execution', 'value'));
return $this->filterByOptions($records, $options);
}
@@ -64,6 +64,13 @@ class scale_of_story_in_execution_when_starting extends baseCalc
$this->result[$execution] += $estimate;
}
$executions = $this->getExecutions();
$beginExecutions = array_filter($executions, function($execution) { return !empty($execution->realBegan); });
foreach($beginExecutions as $executionID => $executionInfo)
{
if(!isset($this->result[$executionID])) $this->result[$executionID] = 0;
}
$records = $this->getRecords(array('execution', 'value'));
return $this->filterByOptions($records, $options);
}