Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove rounding from processor count statistic classes #25

Merged
merged 1 commit into from
Jan 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AverageProcessorCountStatistic extends \DataWarehouse\Query\Jobs\Statistic
public function __construct($query_instance = NULL)
{
$job_count_formula = $query_instance->getQueryType() == 'aggregate'?'job_count':'running_job_count';
parent::__construct('coalesce(ceil(sum(jf.processors*jf.'.$job_count_formula.')/sum(jf.'.$job_count_formula.')),0)', 'avg_processors', 'Job Size: Per Job', 'Core Count',1);
parent::__construct('coalesce(sum(jf.processors*jf.'.$job_count_formula.')/sum(jf.'.$job_count_formula.'),0)', 'avg_processors', 'Job Size: Per Job', 'Core Count',1);
}

public function getInfo()
Expand All @@ -23,4 +23,4 @@ public function getInfo()
}
}

?>
?>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MaxProcessorCountStatistic extends \DataWarehouse\Query\Jobs\Statistic
{
public function __construct($query_instance = NULL)
{
parent::__construct('coalesce(ceil(max(jf.processors)),0)', 'max_processors', 'Job Size: Max', 'Core Count',0);
parent::__construct('coalesce(max(jf.processors),0)', 'max_processors', 'Job Size: Max', 'Core Count',0);
}

public function getInfo()
Expand All @@ -22,4 +22,4 @@ public function getInfo()
}
}

?>
?>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MinProcessorCountStatistic extends \DataWarehouse\Query\Jobs\Statistic
{
public function __construct($query_instance = NULL)
{
parent::__construct('coalesce(ceil(min(case when jf.processors = 0 then null else jf.processors end)),0)', 'min_processors', 'Job Size: Min', 'Core Count',0);
parent::__construct('coalesce(min(case when jf.processors = 0 then null else jf.processors end),0)', 'min_processors', 'Job Size: Min', 'Core Count',0);
$this->setOrderByStat(SORT_DESC);
}
public function getInfo()
Expand All @@ -22,4 +22,4 @@ public function getInfo()
}
}

?>
?>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class NormalizedAverageProcessorCountStatistic extends \DataWarehouse\Query\Jobs
public function __construct($query_instance = NULL)
{
$job_count_formula = $query_instance->getQueryType() == 'aggregate'?'job_count':'running_job_count';
parent::__construct('100.0*coalesce(ceil(sum(jf.processors*jf.'.$job_count_formula.')/sum(jf.'.$job_count_formula.'))/(select sum(rrf.processors) from modw.resourcespecs rrf where find_in_set(rrf.resource_id,group_concat(distinct jf.resource_id)) <> 0 and '.$query_instance->getAggregationUnit()->getUnitName().'_end_ts >= rrf.start_date_ts and (rrf.end_date_ts is null or '.$query_instance->getAggregationUnit()->getUnitName().'_end_ts <= rrf.end_date_ts)),0)', 'normalized_avg_processors', 'Job Size: Normalized', '% of Total Cores',1);
parent::__construct('100.0*coalesce(sum(jf.processors*jf.'.$job_count_formula.')/sum(jf.'.$job_count_formula.')/(select sum(rrf.processors) from modw.resourcespecs rrf where find_in_set(rrf.resource_id,group_concat(distinct jf.resource_id)) <> 0 and '.$query_instance->getAggregationUnit()->getUnitName().'_end_ts >= rrf.start_date_ts and (rrf.end_date_ts is null or '.$query_instance->getAggregationUnit()->getUnitName().'_end_ts <= rrf.end_date_ts)),0)', 'normalized_avg_processors', 'Job Size: Normalized', '% of Total Cores',1);
}

public function getInfo()
Expand All @@ -23,4 +23,4 @@ public function getInfo()
}
}

?>
?>