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

Enable aggregate view for all "Per Job" statistics in the Jobs realm. #961

Merged
merged 4 commits into from
Jun 13, 2019
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
<?php
namespace DataWarehouse\Query\Jobs\Statistics;

use DataWarehouse\Query\Model\TableField;

class AverageCPUHoursStatistic extends \DataWarehouse\Query\Jobs\Statistic
{
public function __construct($query_instance = null)
public function __construct($query_instance)
{
parent::__construct('COALESCE(SUM(jf.cpu_time)/SUM(jf.running_job_count),0)/3600.0', 'avg_cpu_hours', 'CPU Hours: Per Job', 'CPU Hour', 2);
$job_count = 'jf.running_job_count';

if ($query_instance->getQueryType() == 'aggregate') {
$date_table = $query_instance->getDateTable();
if ($date_table) {
$date_id_field = new TableField($date_table, 'id');
$job_count = 'CASE ' . $date_id_field . ' WHEN ' . $query_instance->getMinDateId() . ' THEN jf.running_job_count ELSE jf.started_job_count END';
}
}

parent::__construct(
"COALESCE(SUM(jf.cpu_time) / SUM($job_count), 0) / 3600.0",
'avg_cpu_hours',
'CPU Hours: Per Job',
'CPU Hour',
2
);
}

public function getInfo()
{
return 'The average CPU hours (number of CPU cores x wall time hours) per ' . ORGANIZATION_NAME . ' job.<br/>For each job, the CPU usage is aggregated. For example, if a job used 1000 CPUs for one minute, it would be aggregated as 1000 CPU minutes or 16.67 CPU hours.';
}

/**
* @see DataWarehouse\Query\Statistic
*/
public function usesTimePeriodTablesForAggregate()
{
return false;
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
<?php
namespace DataWarehouse\Query\Jobs\Statistics;

use DataWarehouse\Query\Model\TableField;

class AverageNodeHoursStatistic extends \DataWarehouse\Query\Jobs\Statistic
{
public function __construct($query_instance = null)
public function __construct($query_instance)
{
$job_count = 'jf.running_job_count';

if ($query_instance->getQueryType() == 'aggregate') {
$date_table = $query_instance->getDateTable();
if ($date_table) {
$date_id_field = new TableField($date_table, 'id');
$job_count = 'CASE ' . $date_id_field . ' WHEN ' . $query_instance->getMinDateId() . ' THEN jf.running_job_count ELSE jf.started_job_count END';
}
}
parent::__construct(
'COALESCE(SUM(jf.node_time)/SUM(jf.running_job_count),0)/3600.0',
"COALESCE(SUM(jf.node_time) / SUM($job_count), 0) / 3600.0",
'avg_node_hours',
'Node Hours: Per Job',
'Node Hour',
Expand All @@ -18,12 +29,4 @@ public function getInfo()
{
return 'The average node hours (number of nodes x wall time hours) per ' . ORGANIZATION_NAME . ' job.';
}

/**
* @see DataWarehouse\Query\Statistic
*/
public function usesTimePeriodTablesForAggregate()
{
return false;
}
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
<?php
namespace DataWarehouse\Query\Jobs\Statistics;

use DataWarehouse\Query\Model\TableField;

class AverageProcessorCountStatistic extends \DataWarehouse\Query\Jobs\Statistic
{
public function __construct($query_instance = null)
public function __construct($query_instance)
{
parent::__construct('COALESCE(SUM(jf.processor_count*jf.running_job_count)/SUM(jf.running_job_count),0)', 'avg_processors', 'Job Size: Per Job', 'Core Count', 1);
$job_count = 'jf.running_job_count';

if ($query_instance->getQueryType() == 'aggregate') {
$date_table = $query_instance->getDateTable();
if ($date_table) {
$date_id_field = new TableField($date_table, 'id');
$job_count = 'CASE ' . $date_id_field . ' WHEN ' . $query_instance->getMinDateId() . ' THEN jf.running_job_count ELSE jf.started_job_count END';
}
}

parent::__construct(
"COALESCE(SUM(jf.processor_count * $job_count) / SUM($job_count), 0)",
'avg_processors',
'Job Size: Per Job',
'Core Count',
1
);
}

public function getInfo()
{
return 'The average job size per ' . ORGANIZATION_NAME . ' job.<br><i>Job Size: </i>The number of processor cores used by a (parallel) job.';
}

/**
* @see DataWarehouse\Query\Statistic
*/
public function usesTimePeriodTablesForAggregate()
{
return false;
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
<?php
namespace DataWarehouse\Query\Jobs\Statistics;

use DataWarehouse\Query\Model\TableField;

class NormalizedAverageProcessorCountStatistic extends \DataWarehouse\Query\Jobs\Statistic
{
public function __construct($query_instance = null)
public function __construct($query_instance)
{
$job_count = 'jf.running_job_count';

if ($query_instance->getQueryType() == 'aggregate') {
$date_table = $query_instance->getDateTable();
if ($date_table) {
$date_id_field = new TableField($date_table, 'id');
$job_count = 'CASE ' . $date_id_field . ' WHEN ' . $query_instance->getMinDateId() . ' THEN jf.running_job_count ELSE jf.started_job_count END';
}
}

parent::__construct(
'100.0 *
COALESCE(
SUM(jf.processor_count * jf.running_job_count)
SUM(jf.processor_count * ' . $job_count . ')
/
SUM(jf.running_job_count)
SUM(' . $job_count . ')
/
(
SELECT
Expand Down Expand Up @@ -40,12 +52,4 @@ public function getInfo()
{
return 'The percentage average size ' . ORGANIZATION_NAME . ' job over total machine cores.<br><i>Normalized Job Size: </i>The percentage total number of processor cores used by a (parallel) job over the total number of cores on the machine.';
}

/**
* @see DataWarehouse\Query\Statistic
*/
public function usesTimePeriodTablesForAggregate()
{
return false;
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,49 @@
{
"success": false,
"count": 0,
"total": 0,
"totalCount": 0,
"results": [
title
"CPU Hours: Per Job: by PI Group"
parameters

],
"data": [

],
"message": "{\"statistic\":\"CPU Hours: Per Job\",\"instructions\":\"Try again as timeseries\",\"description\":\"Aggregate View not supported\"}",
"code": 104
}
start,end
2016-12-22,2017-01-01
---------
"PI Group","CPU Hours: Per Job","Std Dev: CPU Hours: Per Job"
"Organic and Macromolecular Chemistry",4770.96515556,
"Fluid, Particulate, and Hydraulic Systems",4368.65777778,1642.1290224563402
"Quantum Electronics, Waves, and Beams",3349.41898359,
"Metals, Ceramics, and Electronic Materials",2627.28571429,
"Structures and Building Systems",1767.64000000,
"Emerging Technologies Initiation",1217.11333333,
"Stellar Astronomy and Astrophysics",1099.78650000,28.16858688077423
"Polar Aeronomy and Astrophysics",1006.98777778,
"Volcanology and Mantle Geochemistry",960.13333333,
"Global Atmospheric Research",722.24444444,221.86209986841982
"Statistics and Probability",646.25423868,
"Design and Computer-Integrated Engineering",584.70172840,
"Theoretical Physics",529.63777778,
"Algebra and Number Theory",472.55000000,
Biophysics,350.97654122,92.37868584083421
"Solid State Chemistry and Polymers",229.08605023,40.75001779915322
"Experimental Systems",199.11258258,
Arts,188.13274411,2.041452970260724
"Geology and Paleontology",147.58368056,100.57359969220543
"Cell Biology",120.93180941,7.498289082723488
"Biochemistry and Molecular Structure and Function",68.10298148,26.371499330539592
Seismology,62.26494444,16.730860685172974
"Operations Research and Production Systems",49.85089556,
"Design, Tools, and Test",28.14000000,0
"Systems Prototyping and Fabrication",25.48654262,
"Polar Ocean and Climate Systems",25.28805115,0.5677021199320009
Economics,20.97018519,8.396540327209507
"Solid-State and Microstructures",20.18978548,2.707858002197733
"Galactic Astronomy",18.09286078,3.3250117057748407
"Physical Chemistry",9.96996384,0.8667729813875754
Tectonics,8.59051583,
"Systematic and Population Biology",6.35208275,0.7295707950782502
"Extragalactic Astronomy and Cosmology",5.98691667,0.9781127830854605
"Computer and Computation Theory",5.04208333,1.412736659063767
Sociology,2.92105820,0.019372743040016592
Geophysics,1.60992063,0.44663758019891886
"Law and Social Sciences",1.04000000,0
"Mechanics and Materials",0.97173942,0.00025764463006399947
"Polar Meteorology",0.88155664,0.09909785167735996
"Decision, Risk, and Management Science",0.44956007,0.3891122786101412
---------
Original file line number Diff line number Diff line change
@@ -1,14 +1,49 @@
{
"success": false,
"count": 0,
"total": 0,
"totalCount": 0,
"results": [
title
"CPU Hours: Per Job: by PI Group"
parameters

],
"data": [

],
"message": "{\"statistic\":\"CPU Hours: Per Job\",\"instructions\":\"Try again as timeseries\",\"description\":\"Aggregate View not supported\"}",
"code": 104
}
start,end
2016-12-22,2017-01-01
---------
"PI Group","CPU Hours: Per Job","Std Dev: CPU Hours: Per Job"
"Organic and Macromolecular Chemistry",4770.96515556,1280.6779521962624
"Fluid, Particulate, and Hydraulic Systems",4368.65777778,3398.832310418393
"Quantum Electronics, Waves, and Beams",3349.41898359,483.5702375532598
"Metals, Ceramics, and Electronic Materials",2627.28571429,173.36998095799686
"Structures and Building Systems",1767.64000000,158.84195310837734
"Emerging Technologies Initiation",1217.11333333,41.359060776731056
"Stellar Astronomy and Astrophysics",1099.78650000,285.31920900832716
"Polar Aeronomy and Astrophysics",1006.98777778,712.0416008450284
"Volcanology and Mantle Geochemistry",960.13333333,0
"Global Atmospheric Research",722.24444444,508.25264083286396
"Statistics and Probability",646.25423868,51.459856675505876
"Design and Computer-Integrated Engineering",584.70172840,
"Theoretical Physics",529.63777778,46.636532607630166
"Algebra and Number Theory",472.55000000,42.08961460801514
Biophysics,350.97654122,220.00497833274875
"Solid State Chemistry and Polymers",229.08605023,76.31072359860417
"Experimental Systems",199.11258258,23.468158632214884
Arts,188.13274411,16.44278594480015
"Geology and Paleontology",147.58368056,114.52976296802045
"Cell Biology",120.93180941,23.278643251385912
"Biochemistry and Molecular Structure and Function",68.10298148,53.28768177700803
Seismology,62.26494444,18.726467654568296
"Operations Research and Production Systems",49.85089556,1.1100595034642202
"Design, Tools, and Test",28.14000000,0
"Systems Prototyping and Fabrication",25.48654262,0.09521527865289223
"Polar Ocean and Climate Systems",25.28805115,0.5677021199320009
Economics,20.97018519,8.396540327209507
"Solid-State and Microstructures",20.18978548,2.814335511780527
"Galactic Astronomy",18.09286078,5.960009068465851
"Physical Chemistry",9.96996384,1.3696184350054212
Tectonics,8.59051583,0.027937647321332644
"Systematic and Population Biology",6.35208275,0.7295707950782502
"Extragalactic Astronomy and Cosmology",5.98691667,0.9781127830854605
"Computer and Computation Theory",5.04208333,1.9381499596292342
Sociology,2.92105820,0.02265708678309858
Geophysics,1.60992063,0.44663758019891886
"Law and Social Sciences",1.04000000,0
"Mechanics and Materials",0.97173942,0.00025764463006399947
"Polar Meteorology",0.88155664,0.09909785167735996
"Decision, Risk, and Management Science",0.44956007,0.42794057709117733
---------
Original file line number Diff line number Diff line change
@@ -1,14 +1,49 @@
{
"success": false,
"count": 0,
"total": 0,
"totalCount": 0,
"results": [
title
"CPU Hours: Per Job: by PI Group"
parameters

],
"data": [

],
"message": "{\"statistic\":\"CPU Hours: Per Job\",\"instructions\":\"Try again as timeseries\",\"description\":\"Aggregate View not supported\"}",
"code": 104
}
start,end
2016-12-22,2017-01-01
---------
"PI Group","CPU Hours: Per Job","Std Dev: CPU Hours: Per Job"
"Organic and Macromolecular Chemistry",4770.96515556,1280.6779521962624
"Fluid, Particulate, and Hydraulic Systems",4368.65777778,3398.832310418393
"Quantum Electronics, Waves, and Beams",3349.41898359,483.5702375532598
"Metals, Ceramics, and Electronic Materials",2627.28571429,173.36998095799686
"Structures and Building Systems",1767.64000000,158.84195310837734
"Emerging Technologies Initiation",1217.11333333,41.359060776731056
"Stellar Astronomy and Astrophysics",1099.78650000,285.31920900832716
"Polar Aeronomy and Astrophysics",1006.98777778,712.0416008450284
"Volcanology and Mantle Geochemistry",960.13333333,0
"Global Atmospheric Research",722.24444444,508.25264083286396
"Statistics and Probability",646.25423868,51.459856675505876
"Design and Computer-Integrated Engineering",584.70172840,
"Theoretical Physics",529.63777778,46.636532607630166
"Algebra and Number Theory",472.55000000,42.08961460801514
Biophysics,350.97654122,220.00497833274875
"Solid State Chemistry and Polymers",229.08605023,76.31072359860417
"Experimental Systems",199.11258258,23.468158632214884
Arts,188.13274411,16.44278594480015
"Geology and Paleontology",147.58368056,114.52976296802045
"Cell Biology",120.93180941,23.278643251385912
"Biochemistry and Molecular Structure and Function",68.10298148,53.28768177700803
Seismology,62.26494444,18.726467654568296
"Operations Research and Production Systems",49.85089556,1.1100595034642202
"Design, Tools, and Test",28.14000000,0
"Systems Prototyping and Fabrication",25.48654262,0.09521527865289223
"Polar Ocean and Climate Systems",25.28805115,0.5677021199320009
Economics,20.97018519,8.396540327209507
"Solid-State and Microstructures",20.18978548,2.814335511780527
"Galactic Astronomy",18.09286078,5.960009068465851
"Physical Chemistry",9.96996384,1.3696184350054212
Tectonics,8.59051583,0.027937647321332644
"Systematic and Population Biology",6.35208275,0.7295707950782502
"Extragalactic Astronomy and Cosmology",5.98691667,0.9781127830854605
"Computer and Computation Theory",5.04208333,1.9381499596292342
Sociology,2.92105820,0.02265708678309858
Geophysics,1.60992063,0.44663758019891886
"Law and Social Sciences",1.04000000,0
"Mechanics and Materials",0.97173942,0.00025764463006399947
"Polar Meteorology",0.88155664,0.09909785167735996
"Decision, Risk, and Management Science",0.44956007,0.42794057709117733
---------
Loading