Commit 479cf37c authored by Leigh Stoller's avatar Leigh Stoller

Change the experiment related panels to show per-portal info instead

data from all Portals.
parent 834eed95
......@@ -40,6 +40,8 @@ $scales = array("Day" => (24 * 3600),
function Do_GetStats()
{
global $scales, $geni_response_codes, $urn_mapping, $TBBASE;
global $PORTAL_GENESIS, $ISEMULAB;
$pclause = " ";
if (! (ISADMIN() || ISFOREIGN_ADMIN())) {
SPITAJAX_ERROR(1, "Not enough permission");
......@@ -52,20 +54,24 @@ function Do_GetStats()
$breakdown["timedout"] = array();
$breakdown["mapping"] = array();
$breakdown["other"] = array();
$pclause = "portal='$PORTAL_GENESIS' and ";
foreach ($scales as $key => $age) {
$query_result =
DBQueryFatal("select ".
"(select count(uuid) from apt_instances ".
" where started > DATE_SUB(now(),interval $age second)),".
" where $pclause ".
" started > DATE_SUB(now(),interval $age second)),".
"(select count(uuid) from apt_instance_history ".
" where started > DATE_SUB(now(),interval $age second))");
" where $pclause ".
" started > DATE_SUB(now(),interval $age second))");
$row = mysql_fetch_array($query_result);
$started[$key] = $row[0] + $row[1];
$query_result =
DBQueryFatal("select count(uuid) from apt_instance_failures ".
" where started > DATE_SUB(now(),interval $age second)");
" where $pclause ".
" started > DATE_SUB(now(),interval $age second)");
$row = mysql_fetch_array($query_result);
$errors[$key] = $row[0] + $row[1];
......@@ -76,7 +82,8 @@ function Do_GetStats()
$query_result =
DBQueryFatal("select exitcode,count(exitcode) as count ".
" from apt_instance_failures ".
"where started>DATE_SUB(now(),interval $age second)".
"where $pclause ".
" started>DATE_SUB(now(),interval $age second)".
"group by exitcode");
while ($row = mysql_fetch_array($query_result)) {
$exitcode = $row[0];
......@@ -101,7 +108,8 @@ function Do_GetStats()
#
# What are most recent swapins
#
$latest = array();
$pclause = "where portal='$PORTAL_GENESIS' ";
$latest = array();
$query_result =
DBQueryFatal("select i.name,i.uuid,i.creator,i.creator_idx,".
......@@ -110,6 +118,7 @@ function Do_GetStats()
"from apt_instances as i ".
"left join apt_profiles as p on ".
" p.profileid=i.profile_id ".
$pclause .
"order by started desc limit 5");
while ($row = mysql_fetch_array($query_result)) {
$name = $row["name"];
......@@ -206,6 +215,7 @@ function Do_GetStats()
#
# Detailed info on the 10 most recent errors.
#
$pclause = "where f.portal='$PORTAL_GENESIS' ";
$error_details = array();
$query_result =
......@@ -222,6 +232,7 @@ function Do_GetStats()
" h.uuid=f.uuid ".
"left join apt_profiles as p on ".
" p.profileid=f.profile_id ".
$pclause .
"order by f.started desc limit 10");
while ($row = mysql_fetch_array($query_result)) {
......
<?php
#
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
# Copyright (c) 2000-2019 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -50,6 +50,17 @@ echo " window.ISADMIN = $isadmin;\n";
echo " window.ISFADMIN = $isfadmin;\n";
echo "</script>\n";
$am_list = Aggregate::DefaultAggregateList();
$am_array = array();
while (list($index, $aggregate) = each($am_list)) {
$nick = $aggregate->nickname();
$am_array[$nick] = $nick;
}
echo "<script type='text/plain' id='amlist-json'>\n";
echo htmlentities(json_encode($am_array));
echo "</script>\n";
REQUIRE_UNDERSCORE();
REQUIRE_SUP();
REQUIRE_MOMENT();
......
......@@ -5,11 +5,15 @@ $(function ()
var dashboardTemplate = _.template(templates['dashboard']);
var clusterFiles = ["cloudlab-nofed.json", "cloudlab-fedonly.json"];
var clusterStats = {};
var amlist = null;
function initialize()
{
window.APT_OPTIONS.initialize(sup);
amlist = JSON.parse(_.unescape($('#amlist-json')[0].textContent));
console.info(amlist);
DashboardLoop();
setInterval(DashboardLoop,30000);
setInterval(UpdateTimes,1000);
......@@ -140,6 +144,9 @@ $(function ()
for (var index = 0; index < clusterFiles.length; index++) {
var jqxhr = $.getJSON(clusterFiles[index], function(blob) {
$.each(blob.children, function(idx, site) {
if (!_.has(amlist, site.name)) {
return;
}
var stats = {"total" : 0,
"inuse" : 0,
"ratio" : 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment