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; } 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"; } $testPath = $_GET["path"]; if (!$sortMethod) { $testPath = "evol/20131009/"; } $commandCount = 1; $commands; $tests = array(); $dir = opendir($testPath); while ($file = readdir($dir)) { 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 | Runetime | Locktime | Msgcount | Locktime per Msg | Locktime per runtime |
|---|---|---|---|---|---|
| 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
};