From 8f2a689e925c45221af985951da9a6a3752d0d87 Mon Sep 17 00:00:00 2001 From: stubbfel Date: Fri, 29 Nov 2013 13:03:50 +0100 Subject: [PATCH] updat20131129 --- TestViewSequenz.php | 9 ++- index.php | 140 ++++++++++++++++++++++++++++++++-- nbproject/private/private.xml | 9 +++ 3 files changed, 150 insertions(+), 8 deletions(-) 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 ""; -echo ""; +echo ""; usort($tests, $sortMethod); + foreach ($tests as $testcase) { echo ""; - echo ""; + echo ""; echo ""; } echo "
SettingcommandRunetimeLocktimeMsgcountLocktime per MsgLocktime per Command
SettingRunetimeLocktimeMsgcountLocktime per MsgLocktime per runtime
path\" target=\"_blank\">$testcase->name$commandCount$testcase->runTime$testcase->lockTime$testcase->msgCount" . $testcase->lockTime / $testcase->msgCount . "" . $testcase->lockTime / $commandCount . "path\" target=\"_blank\">$testcase->name$testcase->runTime$testcase->lockTime$testcase->msgCount" . $testcase->lockTimeMsgCount . "" . $testcase->lockRunTime . "
"; +echo "Settings:
"; +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
+        };  
+

"; +echo "commands:
"; +$index = 0; +foreach ($commands as $command) { + echo $index++ . " => " . $command . "
"; +} ?> diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index 4750962..a73c5fa 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -1,4 +1,13 @@ + + + file:/home/stubbfel/projects/Mranalysis/evol/20131114/50_50/setup.dat + file:/home/stubbfel/projects/Mranalysis/testlist.html + file:/home/stubbfel/projects/Mranalysis/createplot.php + file:/home/stubbfel/projects/Mranalysis/TestViewSequenz.php + file:/home/stubbfel/projects/Mranalysis/index.php + +