diff --git a/TestViewSequenz.php b/TestViewSequenz.php index b70b39e..9ce53f6 100644 --- a/TestViewSequenz.php +++ b/TestViewSequenz.php @@ -10,8 +10,13 @@ class TestViewSequenz { public $msgCount; public $name; public $path; + public $lockRunTime; + public $lockTimeMsgCount; - public function __construct($testFile) { + public function __construct($testFile = null) { + if (!$testFile) { + return; + } $this->path = $testFile; $sourceString = file_get_contents($testFile); @@ -37,6 +42,8 @@ class TestViewSequenz { } $this->name = str_replace(".json", "", basename($testFile)); + $this->lockRunTime = $this->lockTime / $this->runTime; + $this->lockTimeMsgCount = $this->lockTime / $this->msgCount; } public function toHTML() { diff --git a/index.php b/index.php index f73c0db..92ee21d 100644 --- a/index.php +++ b/index.php @@ -23,7 +23,6 @@ function cmpLockTime($a, $b) { return ($a->lockTime < $b->lockTime) ? -1 : 1; } - function cmpMsgCount($a, $b) { if ($a->msgCount == $b->msgCount) { return 0; @@ -31,29 +30,156 @@ function cmpMsgCount($a, $b) { return ($a->msgCount < $b->msgCount) ? 1 : -1; } +function aggrateTest($querry, $tests, $name) { + $tmpTest = new TestViewSequenz(); + + $count = 0; + foreach ($tests as $key => $value) { + if (preg_match($querry, $key) == true) { + $count++; + $tmpTest->msgCount += $value->msgCount; + $tmpTest->lockTime += $value->lockTime; + $tmpTest->runTime += $value->runTime; + $tmpTest->lockTimeMsgCount += $value->lockTimeMsgCount; + $tmpTest->lockRunTime += $value->lockRunTime; + } + } + + $tmpTest->msgCount /= $count; + $tmpTest->lockTime /= $count; + $tmpTest->runTime /= $count; + $tmpTest->lockTimeMsgCount /= $count; + $tmpTest->lockRunTime /= $count; + $tmpTest->name = $name; + return $tmpTest; +} + +function createAggKeyList() { + $maxFirst = 2; + $firstX = "[0-$maxFirst]"; + + $maxSecond = 2; + $secondX = "[0-$maxSecond]"; + + $maxThird = 5; + $thirdX = "[0-$maxThird]"; + + $keyList = array(); + + for ($i = 0; $i <= $maxFirst + 1; $i++) { + + if ($i > $maxFirst) { + $firstChar = "x"; + $firstRegex = $firstX; + } else { + $firstChar = "$i"; + $firstRegex = "$i"; + } + + for ($j = 0; $j <= $maxSecond + 1; $j++) { + + if ($j > $maxSecond) { + $secondChar = "x"; + $secondRegex = $secondX; + } else { + $secondChar = "$j"; + $secondRegex = "$j"; + } + + for ($k = 0; $k <= $maxThird + 1; $k++) { + + if ($k > $maxThird) { + $thirdChar = "x"; + $thirdRegex = $thirdX; + } else { + $thirdChar = "$k"; + $thirdRegex = "$k"; + } + + $tmpName = $firstChar . $secondChar . $thirdChar; + $tmpRegex = '/^' . $firstRegex . $secondRegex . $thirdRegex . '$/'; + + if (strpos($tmpName, "x") === false) { + continue; + } + + $keyList["$tmpName"] = $tmpRegex; + } + } + } + return $keyList; +} + $sortMethod = $_GET["sort"]; if (!$sortMethod) { $sortMethod = "cmpName"; } -$commandCount = 10; +$testPath = $_GET["path"]; +if (!$sortMethod) { + $testPath = "evol/20131009/"; +} + +$commandCount = 1; +$commands; $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)); + if (eregi("[0-9]{2,3}.json", $file) && !eregi("[0-9]{2,3}.json_", $file)) { + $tmpTest = new TestViewSequenz($testPath . $file); + $tests["$tmpTest->name"] = $tmpTest; + } else if (eregi("commands.json", $file)) { + $sourceString = file_get_contents($testPath . $file); + $source = json_decode($sourceString, true); + $commandCount = count($source); + $commands = $source; } } + +$keys = createAggKeyList(); + +foreach ($keys as $key => $value) { + $tests["$key"] = aggrateTest($value, $tests, "$key"); +} + echo "
| Setting | command | Runetime | Locktime | Msgcount | Locktime per Msg | Locktime per Command | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Setting | Runetime | Locktime | Msgcount | Locktime per Msg | Locktime per runtime | |||||||
| path\" target=\"_blank\">$testcase->name | $commandCount | $testcase->runTime | $testcase->lockTime | $testcase->msgCount | " . $testcase->lockTime / $testcase->msgCount . " | " . $testcase->lockTime / $commandCount . " | "; + echo "path\" target=\"_blank\">$testcase->name | $testcase->runTime | $testcase->lockTime | $testcase->msgCount | " . $testcase->lockTimeMsgCount . " | " . $testcase->lockRunTime . " | "; echo "
+ enum PeerPlacingStrategyType {
+ BALANCED_PEER_PLACING = 0,
+ CREATE_MASTER_FIRST,
+ DYNAMIC_PEER_PLACING
+ };
+
+ enum PeerPlacingStrategyMetricType {
+ OUCMETRIC_CLUSTERSIZE = 0,
+ OUCMETRIC_RESOURCEVALUE,
+ OUCMETRIC_RESOURCEVALUECLUSTERSIZE
+ };
+
+ enum MaintanceMomentMetricType {
+ NOMOMENTMETRIC = 0,
+ RESOURCEVALUEMOMENTMETRIC,
+ MESSAGESEQCOUNTMOMENTMETRIC,
+ LOGICTIMEMOMENTMETRIC,
+ MESSAGECOUNTMOMENTMETRIC
+ };
+