\n"; ?>
Grid statistics
\n"; ?>
"; dbDisplayTable ($V_TableName); echo ""; } else { /* no specific table selected */ $contentClass = "CONTENT2"; echo "
\n"; echo " \n"; echo "\n"; $connection = dbConnect (); $query = "select sum(nbjobs) from apps"; $result = dbQuery ($connection, $query); $nbjobs= mysql_fetch_array($result); echo "
"; echo $nbjobs[0]." jobs already executed"; echo "
\n"; echo "\n"; echo " \n"; /* * Available giga hertz * This should be simplyfied by the inner SQL query * select sum(gigaTotal) from \ * (select cpuspeed*cpunb/1000 as gigaTotal from hosts group by name,ipaddr) as gigaTotal; * * But this is only understood by MySQL >= 4.1 * :( */ $queryGigaTotal = "select cpuspeed*cpunb/1000 as gigaTotal from hosts group by name,ipaddr"; $resultGigaTotal = dbQuery ($connection, $queryGigaTotal); $gigaTotal = 0; while ($rowsGigaTotal = mysql_fetch_array($resultGigaTotal)) { $gigaTotal += $rowsGigaTotal["gigaTotal"]; } $queryGigaDispo = "select cpuspeed*cpunb/1000 as gigaDispo from hosts". $queryGigaDispo = $queryGigaDispo." where active='true' and available='true' and now()-lastAlive < 4500 and not isnull(lastAlive) group by name,ipaddr"; $resultGigaDispo = dbQuery ($connection, $queryGigaDispo); $gigaDispo = 0; while ($rowsGigaDispo = mysql_fetch_array($resultGigaDispo)) { $gigaDispo += $rowsGigaDispo["gigaDispo"]; } $queryAvailableWorkers = "select count(*) from hosts group by name,ipaddr"; $resultAvailableWorkers = dbQuery ($connection, $queryAvailableWorkers); $nbWorkers = 0; while ($rowsAvailableWorkers = mysql_fetch_array($resultAvailableWorkers)) { $nbWorkers++; } $percentDispo = intval ($gigaDispo / $gigaTotal * 100); echo "
"; if ($percentDispo >= 50) echo " "; $diffDispo=100-$percentDispo; if ($diffDispo > 0) { echo "".$nbWorkers." workers ($percentDispo% ready).
"; echo ""; if ($percentDispo < 50) echo $nbRows[$i].$tableTexts[$i]." ($percentDispo% ready)."; echo " "; } echo "\n"; for ($i = 0; $i < count($nbRows); $i++) { $contentClass = "CONTENT".(($i % 2) + 1); $contentClass = "CONTENT2"; echo " \n"; echo " "; } /* Tasks graphs*/ ?>\n"; echo " \n"; if ((isprivileged ($V_Login, $V_Session)) && ($nbRows[$i] > 0)) { echo <<< EOF\n"; echo $nbRows[$i].$tableTexts[$i]; echo "
\n"; echo "EOF; } echo " EOF; echo "
Note
Next stats are dynamically extracted and represent data still in the server
(i.e. removed jobs are out of these statistics)
Tasks
Legend
completed tasks
error tasks
"; if (graphHostLastDay () == 0) $displayLegend = 1; echo "
Hosts
Legend
computing resource
"; */ graphHostLastWeek(); graphHostLastMonth(); graphHostLastYear(); ?>