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

Update statistics and groupbys for consistency #1089

Merged
merged 4 commits into from
Oct 25, 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
Expand Up @@ -21,7 +21,7 @@ public function __construct($query_instance)
parent::__construct(
$sql,
'cloud_avg_wallduration_hours',
'Average Wall Hours per Session',
'Wall Hours: Per Session',
'Hours',
2
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,12 @@ public function __construct($query_instance = null)
parent::__construct(
$sql,
'cloud_num_sessions_running',
'Number of Active Sessions',
'Number of Sessions',
'Number of Sessions Active',
'Sessions',
0
);
}

public function getLabel()
{
return parent::getLabel(false);
}

public function getInfo()
{
return 'The total number of sessions on a cloud resource.<br/><b>Session:</b> A session is defined as a discrete run of a virtual machine (VM) on a cloud resource; i.e. any start and stop of a VM. For example, if a single VM is stopped and restarted ten times in a given day, this would be counted as ten sessions for that day.<br/><b>Start:</b> A session start event is defined as the initial creation, resume from pause/suspension, or unshelving of a VM. In the event that no such event has been collected, the first heartbeat event (e.g. a state report) is treated as the start of a new session.<br/><b>Stop:</b> A session stop event is defined as a pause, shelving, suspension, or termination event of a VM. ';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public function __construct($query_instance = null)
'COALESCE(SUM(jf.num_sessions_ended), 0)',
'cloud_num_sessions_ended',
'Number of Sessions Ended',
'Number of Sessions',
'Sessions',
0
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class StartedSessionsCountStatistic extends \DataWarehouse\Query\Cloud\Statistic
{
public function __construct($query_instance = null)
{
parent::__construct('COALESCE(SUM(jf.num_sessions_started), 0)', 'cloud_num_sessions_started', 'Number of Sessions Started', 'Number of Sessions', 0);
parent::__construct('COALESCE(SUM(jf.num_sessions_started), 0)', 'cloud_num_sessions_started', 'Number of Sessions Started', 'Sessions', 0);
}

public function getInfo()
Expand Down
8 changes: 4 additions & 4 deletions classes/DataWarehouse/Query/Storage/GroupBys/GroupByMonth.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public function __construct()
'
SELECT DISTINCT
gt.id,
DATE(gt.month_start) AS long_name,
DATE(gt.month_start) AS short_name,
DATE_FORMAT(gt.month_start, "%Y-%m") as long_name,
DATE_FORMAT(gt.month_start, "%Y-%m") as short_name,
gt.month_start_ts AS start_ts
FROM months gt
WHERE 1
Expand All @@ -51,11 +51,11 @@ public function applyTo(
$this->getIdColumnName($multiGroup)
);
$nameField = new FormulaField(
'DATE(' . $query->getDateTable()->getAlias() . '.month_start)',
'DATE_FORMAT(' . $query->getDateTable()->getAlias() . '.month_start, "%Y-%m")',
$this->getLongNameColumnName($multiGroup)
);
$shortnameField = new FormulaField(
'DATE(' . $query->getDateTable()->getAlias() . '.month_start)',
'DATE_FORMAT(' . $query->getDateTable()->getAlias() . '.month_start, "%Y-%m")',
$this->getShortNameColumnName($multiGroup)
);
$valueField = new TableField(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,8 @@ public function pullQueryParameters(&$request)
'fos_id'
);
}
public function getDefaultDatasetType()
{
return 'aggregate';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public function __construct()
'
SELECT DISTINCT
gt.id,
DATE(gt.quarter_start) AS long_name,
DATE(gt.quarter_start) AS short_name,
CONCAT(YEAR(gt.quarter_start)," Q", CEIL(MONTH(gt.quarter_start)/3)) AS long_name,
CONCAT(YEAR(gt.quarter_start)," Q", CEIL(MONTH(gt.quarter_start)/3)) AS short_name,
gt.quarter_start_ts AS start_ts
FROM quarters gt
WHERE 1
Expand All @@ -51,11 +51,11 @@ public function applyTo(
$this->getIdColumnName($multiGroup)
);
$nameField = new FormulaField(
'DATE(' . $query->getDateTable()->getAlias() . '.quarter_start)',
'CONCAT(YEAR(' . $query->getDateTable()->getAlias() . '.quarter_start)," Q", CEIL(MONTH(' . $query->getDateTable()->getAlias() . '.quarter_start)/3))',
$this->getLongNameColumnName($multiGroup)
);
$shortnameField = new FormulaField(
'DATE(' . $query->getDateTable()->getAlias() . '.quarter_start)',
'CONCAT(YEAR(' . $query->getDateTable()->getAlias() . '.quarter_start)," Q", CEIL(MONTH(' . $query->getDateTable()->getAlias() . '.quarter_start)/3))',
$this->getShortNameColumnName($multiGroup)
);
$valueField = new TableField(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,8 @@ public function applyTo(

$this->addOrder($query, $multi_group);
}
public function getDefaultDatasetType()
{
return 'aggregate';
}
}
8 changes: 4 additions & 4 deletions classes/DataWarehouse/Query/Storage/GroupBys/GroupByYear.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public function __construct()
'
SELECT DISTINCT
gt.id,
DATE(gt.year_start) AS long_name,
DATE(gt.year_start) AS short_name,
DATE_FORMAT(gt.year_start, "%Y") AS long_name,
DATE_FORMAT(gt.year_start, "%Y") AS short_name,
gt.year_start_ts AS start_ts
FROM years gt
WHERE 1
Expand All @@ -51,11 +51,11 @@ public function applyTo(
$this->getIdColumnName($multiGroup)
);
$nameField = new FormulaField(
'DATE(' . $query->getDateTable()->getAlias() . '.year_start)',
'DATE_FORMAT(' . $query->getDateTable()->getAlias() . '.year_start, "%Y")',
$this->getLongNameColumnName($multiGroup)
);
$shortnameField = new FormulaField(
'DATE(' . $query->getDateTable()->getAlias() . '.year_start)',
'DATE_FORMAT(' . $query->getDateTable()->getAlias() . '.year_start, "%Y")',
$this->getShortNameColumnName($multiGroup)
);
$valueField = new TableField(
Expand Down
4 changes: 2 additions & 2 deletions shippable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ build:
- ./tests/ci/validate.sh
- composer install --no-progress
- ./tests/regression/runtests.sh --junit-output-dir `pwd`/shippable/testresults/
- cp ./configuration/portal_settings.ini ./configuration/portal_settings.ini.old
- cp -f /etc/xdmod/portal_settings.ini ./configuration/portal_settings.ini
- mv ./configuration/portal_settings.ini ./configuration/portal_settings.ini.old
- cp /etc/xdmod/portal_settings.ini ./configuration/portal_settings.ini
- ./tests/integration/runtests.sh --junit-output-dir `pwd`/shippable/testresults/
- ./tests/regression/post_ingest_test.sh --junit-output-dir `pwd`/shippable/testresults/
- ./tests/component/runtests.sh --log-junit `pwd`/shippable/testresults/xdmod-component.xml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
title
"Average Wall Hours per Session: by Instance Type"
"Wall Hours: Per Session: by Instance Type"
parameters

start,end
2018-04-18,2018-04-30
---------
"Instance Type","Average Wall Hours per Session"
"Instance Type","Wall Hours: Per Session"
c2.m4,52.40465278
c4.m16,35.26490741
c1.m4,23.19631766
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
title
"Average Wall Hours per Session: by Instance Type"
"Wall Hours: Per Session: by Instance Type"
parameters

start,end
2018-04-18,2018-04-30
---------
"Instance Type","Average Wall Hours per Session"
"Instance Type","Wall Hours: Per Session"
c2.m4,52.40465278
c4.m16,35.26490741
c1.m4,23.19631766
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
title
"Average Wall Hours per Session: by Instance Type"
"Wall Hours: Per Session: by Instance Type"
parameters

start,end
2018-04-18,2018-04-30
---------
"Instance Type","Average Wall Hours per Session"
"Instance Type","Wall Hours: Per Session"
c2.m4,52.40465278
c4.m16,35.26490741
c1.m4,23.19631766
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
title
"Average Wall Hours per Session: by Instance Type"
"Wall Hours: Per Session: by Instance Type"
parameters

start,end
2018-04-18,2018-04-30
---------
"Instance Type","Average Wall Hours per Session"
"Instance Type","Wall Hours: Per Session"
c2.m4,52.40465278
c4.m16,35.26490741
c1.m4,23.19631766
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
title
"Average Wall Hours per Session: by Instance Type"
"Wall Hours: Per Session: by Instance Type"
parameters

start,end
2018-04-18,2018-04-30
---------
Day,"[c2.m4] Average Wall Hours per Session","[c4.m16] Average Wall Hours per Session","[c1.m4] Average Wall Hours per Session","[c1.m1] Average Wall Hours per Session","[c2.m8] Average Wall Hours per Session"
Day,"[c2.m4] Wall Hours: Per Session","[c4.m16] Wall Hours: Per Session","[c1.m4] Wall Hours: Per Session","[c1.m1] Wall Hours: Per Session","[c2.m8] Wall Hours: Per Session"
2018-04-18,0.70833333,2.21361111,1.91267974,0.01555556,0.23583333
2018-04-19,7.89694444,0,5.55785088,0.23340278,0
2018-04-20,24.00000000,0,4.90686111,0,0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
title
"Average Wall Hours per Session: by Instance Type"
"Wall Hours: Per Session: by Instance Type"
parameters

start,end
2018-04-18,2018-04-30
---------
Month,"[c2.m4] Average Wall Hours per Session","[c4.m16] Average Wall Hours per Session","[c1.m4] Average Wall Hours per Session","[c1.m1] Average Wall Hours per Session","[c2.m8] Average Wall Hours per Session"
Month,"[c2.m4] Wall Hours: Per Session","[c4.m16] Wall Hours: Per Session","[c1.m4] Wall Hours: Per Session","[c1.m1] Wall Hours: Per Session","[c2.m8] Wall Hours: Per Session"
2018-04,52.40465278,35.26490741,23.19631766,1.10337963,0.23583333
---------
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
title
"Average Wall Hours per Session: by Instance Type"
"Wall Hours: Per Session: by Instance Type"
parameters

start,end
2018-04-18,2018-04-30
---------
Quarter,"[c2.m4] Average Wall Hours per Session","[c4.m16] Average Wall Hours per Session","[c1.m4] Average Wall Hours per Session","[c1.m1] Average Wall Hours per Session","[c2.m8] Average Wall Hours per Session"
Quarter,"[c2.m4] Wall Hours: Per Session","[c4.m16] Wall Hours: Per Session","[c1.m4] Wall Hours: Per Session","[c1.m1] Wall Hours: Per Session","[c2.m8] Wall Hours: Per Session"
"2018 Q2",52.40465278,35.26490741,23.19631766,1.10337963,0.23583333
---------
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
title
"Average Wall Hours per Session: by Instance Type"
"Wall Hours: Per Session: by Instance Type"
parameters

start,end
2018-04-18,2018-04-30
---------
Year,"[c2.m4] Average Wall Hours per Session","[c4.m16] Average Wall Hours per Session","[c1.m4] Average Wall Hours per Session","[c1.m1] Average Wall Hours per Session","[c2.m8] Average Wall Hours per Session"
Year,"[c2.m4] Wall Hours: Per Session","[c4.m16] Wall Hours: Per Session","[c1.m4] Wall Hours: Per Session","[c1.m1] Wall Hours: Per Session","[c2.m8] Wall Hours: Per Session"
2018,52.40465278,35.26490741,23.19631766,1.10337963,0.23583333
---------
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
title
"Number of Active Sessions: by Instance Type"
"Number of Sessions Active: by Instance Type"
parameters

start,end
2018-04-18,2018-04-30
---------
"Instance Type","Number of Active Sessions (Number of Sessions)"
"Instance Type","Number of Sessions Active"
c1.m4,39
c1.m1,6
c2.m4,4
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
title
"Number of Active Sessions: by Instance Type"
"Number of Sessions Active: by Instance Type"
parameters

start,end
2018-04-18,2018-04-30
---------
"Instance Type","Number of Active Sessions (Number of Sessions)"
"Instance Type","Number of Sessions Active"
c1.m4,39
c1.m1,6
c2.m4,4
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
title
"Number of Active Sessions: by Instance Type"
"Number of Sessions Active: by Instance Type"
parameters

start,end
2018-04-18,2018-04-30
---------
"Instance Type","Number of Active Sessions (Number of Sessions)"
"Instance Type","Number of Sessions Active"
c1.m4,39
c1.m1,6
c2.m4,4
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
title
"Number of Active Sessions: by Instance Type"
"Number of Sessions Active: by Instance Type"
parameters

start,end
2018-04-18,2018-04-30
---------
"Instance Type","Number of Active Sessions (Number of Sessions)"
"Instance Type","Number of Sessions Active"
c1.m4,39
c1.m1,6
c2.m4,4
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
title
"Number of Active Sessions: by Instance Type"
"Number of Sessions Active: by Instance Type"
parameters

start,end
2018-04-18,2018-04-30
---------
Day,"[c1.m4] Number of Active Sessions (Number of Sessions)","[c1.m1] Number of Active Sessions (Number of Sessions)","[c2.m4] Number of Active Sessions (Number of Sessions)","[c4.m16] Number of Active Sessions (Number of Sessions)","[c2.m8] Number of Active Sessions (Number of Sessions)"
Day,"[c1.m4] Number of Sessions Active","[c1.m1] Number of Sessions Active","[c2.m4] Number of Sessions Active","[c4.m16] Number of Sessions Active","[c2.m8] Number of Sessions Active"
2018-04-18,17,1,1,2,1
2018-04-19,19,4,2,0,0
2018-04-20,10,0,1,0,0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
title
"Number of Active Sessions: by Instance Type"
"Number of Sessions Active: by Instance Type"
parameters

start,end
2018-04-18,2018-04-30
---------
Month,"[c1.m4] Number of Active Sessions (Number of Sessions)","[c1.m1] Number of Active Sessions (Number of Sessions)","[c2.m4] Number of Active Sessions (Number of Sessions)","[c4.m16] Number of Active Sessions (Number of Sessions)","[c2.m8] Number of Active Sessions (Number of Sessions)"
Month,"[c1.m4] Number of Sessions Active","[c1.m1] Number of Sessions Active","[c2.m4] Number of Sessions Active","[c4.m16] Number of Sessions Active","[c2.m8] Number of Sessions Active"
2018-04,39,6,4,3,1
---------
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
title
"Number of Active Sessions: by Instance Type"
"Number of Sessions Active: by Instance Type"
parameters

start,end
2018-04-18,2018-04-30
---------
Quarter,"[c1.m4] Number of Active Sessions (Number of Sessions)","[c1.m1] Number of Active Sessions (Number of Sessions)","[c2.m4] Number of Active Sessions (Number of Sessions)","[c4.m16] Number of Active Sessions (Number of Sessions)","[c2.m8] Number of Active Sessions (Number of Sessions)"
Quarter,"[c1.m4] Number of Sessions Active","[c1.m1] Number of Sessions Active","[c2.m4] Number of Sessions Active","[c4.m16] Number of Sessions Active","[c2.m8] Number of Sessions Active"
"2018 Q2",39,6,4,3,1
---------
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
title
"Number of Active Sessions: by Instance Type"
"Number of Sessions Active: by Instance Type"
parameters

start,end
2018-04-18,2018-04-30
---------
Year,"[c1.m4] Number of Active Sessions (Number of Sessions)","[c1.m1] Number of Active Sessions (Number of Sessions)","[c2.m4] Number of Active Sessions (Number of Sessions)","[c4.m16] Number of Active Sessions (Number of Sessions)","[c2.m8] Number of Active Sessions (Number of Sessions)"
Year,"[c1.m4] Number of Sessions Active","[c1.m1] Number of Sessions Active","[c2.m4] Number of Sessions Active","[c4.m16] Number of Sessions Active","[c2.m8] Number of Sessions Active"
2018,39,6,4,3,1
---------
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
title
"Average Wall Hours per Session: by Domain"
"Wall Hours: Per Session: by Domain"
parameters

start,end
2018-04-18,2018-04-30
---------
Domain,"Average Wall Hours per Session"
Domain,"Wall Hours: Per Session"
"Unknown - NutSetters",23.14954403
---------
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
title
"Average Wall Hours per Session: by Domain"
"Wall Hours: Per Session: by Domain"
parameters

start,end
2018-04-18,2018-04-30
---------
Domain,"Average Wall Hours per Session"
Domain,"Wall Hours: Per Session"
"Unknown - NutSetters",23.14954403
---------
Loading