Files
Mranalysis/index.php
2013-10-16 23:29:49 +02:00

60 lines
1.8 KiB
PHP

<?php
include_once 'TestViewSequenz.php';
function cmpRuneTime($a, $b) {
if ($a->runTime == $b->runTime) {
return 0;
}
return ($a->runTime < $b->runTime) ? 1 : -1;
}
function cmpName($a, $b) {
if ($a->name == $b->name) {
return 0;
}
return ($a->name < $b->name) ? -1 : 1;
}
function cmpLockTime($a, $b) {
if ($a->lockTime == $b->lockTime) {
return 0;
}
return ($a->lockTime < $b->lockTime) ? -1 : 1;
}
function cmpMsgCount($a, $b) {
if ($a->msgCount == $b->msgCount) {
return 0;
}
return ($a->msgCount < $b->msgCount) ? 1 : -1;
}
$sortMethod = $_GET["sort"];
if (!$sortMethod) {
$sortMethod = "cmpName";
}
$commandCount = 10;
$tests = array();
$testPath = "evol/20131009/";
$dir = opendir($testPath);
while ($file = readdir($dir)) {
if (eregi("[0-9]{3}.json", $file)) {
array_push($tests, new TestViewSequenz($testPath . $file));
}
}
echo "<table border=\"1\">";
echo "<tr><th><a href=\"?sort=cmpName\">Setting</a></th><th>command</th><th><a href=\"?sort=cmpRuneTime\">Runetime</a></th><th><a href=\"?sort=cmpLockTime\">Locktime</a></th><th><a href=\"?sort=cmpMsgCount\">Msgcount</a></th><th>Locktime per Msg</th><th>Locktime per Command</th></tr>";
usort($tests, $sortMethod);
foreach ($tests as $testcase) {
echo "<tr>";
echo "<td style=\"padding:35px\"><a href=\"testdetails.php?testfile=$testcase->path\" target=\"_blank\">$testcase->name</a></td><td style=\"padding:35px\">$commandCount</td><td style=\"padding:35px\">$testcase->runTime</td><td style=\"padding:35px\">$testcase->lockTime</td><td style=\"padding:35px\">$testcase->msgCount</td><td style=\"padding:35px\">" . $testcase->lockTime / $testcase->msgCount . "</td><td style=\"padding:35px\">" . $testcase->lockTime / $commandCount . "</td>";
echo "</tr>";
}
echo "</table>";
?>