update20131016
This commit is contained in:
62
index.php
62
index.php
@@ -1,15 +1,59 @@
|
||||
<?php
|
||||
|
||||
include_once 'View.php';
|
||||
$sourceString = file_get_contents("mr-t02.json");
|
||||
//echo $sourceString;
|
||||
$source = json_decode($sourceString, true);
|
||||
include_once 'TestViewSequenz.php';
|
||||
|
||||
foreach ($source as $key => $view) {
|
||||
if ($key != "-1") {
|
||||
$viewObj = new View($view, $key);
|
||||
echo $viewObj->toHTML();
|
||||
echo "<br>";
|
||||
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>";
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user