Commit 23eba14e authored by Alan White's avatar Alan White

msg stats

parent bbb2f71e
groovy msgStatsSummarizer.groovy --r paperWorld1/detNonDebil
groovy msgStatsSummarizer.groovy --r paperWorld2/detNonDebil
groovy msgStatsSummarizer.groovy --r paperWorld1-nrisk1/ndebil0
groovy msgStatsSummarizer.groovy --r paperWorld1-nrisk1/ndebil025
groovy msgStatsSummarizer.groovy --r paperWorld1-nrisk1/ndebil05
groovy msgStatsSummarizer.groovy --r paperWorld1-nrisk1/ndebil075
groovy msgStatsSummarizer.groovy --r paperWorld1-nrisk2/ndebil0
groovy msgStatsSummarizer.groovy --r paperWorld1-nrisk2/ndebil025
groovy msgStatsSummarizer.groovy --r paperWorld1-nrisk2/ndebil05
groovy msgStatsSummarizer.groovy --r paperWorld1-nrisk2/ndebil075
groovy msgStatsSummarizer.groovy --r paperWorld1-nrisk3/ndebil0
groovy msgStatsSummarizer.groovy --r paperWorld1-nrisk3/ndebil025
groovy msgStatsSummarizer.groovy --r paperWorld1-nrisk3/ndebil05
groovy msgStatsSummarizer.groovy --r paperWorld1-nrisk3/ndebil075
groovy msgStatsSummarizer.groovy --r paperWorld2-nrisk1/ndebil0
groovy msgStatsSummarizer.groovy --r paperWorld2-nrisk1/ndebil025
groovy msgStatsSummarizer.groovy --r paperWorld2-nrisk1/ndebil05
groovy msgStatsSummarizer.groovy --r paperWorld2-nrisk1/ndebil075
groovy msgStatsSummarizer.groovy --r paperWorld2-nrisk2/ndebil0
groovy msgStatsSummarizer.groovy --r paperWorld2-nrisk2/ndebil025
groovy msgStatsSummarizer.groovy --r paperWorld2-nrisk2/ndebil05
groovy msgStatsSummarizer.groovy --r paperWorld2-nrisk2/ndebil075
groovy msgStatsSummarizer.groovy --r paperWorld2-nrisk3/ndebil0
groovy msgStatsSummarizer.groovy --r paperWorld2-nrisk3/ndebil025
groovy msgStatsSummarizer.groovy --r paperWorld2-nrisk3/ndebil05
groovy msgStatsSummarizer.groovy --r paperWorld2-nrisk3/ndebil075
\ No newline at end of file
...@@ -47,7 +47,6 @@ class MessageStatsParser { ...@@ -47,7 +47,6 @@ class MessageStatsParser {
} }
resultSet[dir.name] = approachResults resultSet[dir.name] = approachResults
} }
println "End results\n$resultSet"
} }
void writeOutResults(loc) { void writeOutResults(loc) {
...@@ -61,34 +60,40 @@ class MessageStatsParser { ...@@ -61,34 +60,40 @@ class MessageStatsParser {
writeme << "ndebil,approach,run,${postFix}\n" //header writeme << "ndebil,approach,run,${postFix}\n" //header
//each entry by key in map //each entry by key in map
println "map is $resultSet" // println "map is $resultSet"
resultSet.each { key, valueMap -> resultSet.each { key, valueMap ->
println "KEY: ${key}" // println "KEY: ${key}"
valueMap.each { runId, performativeCountMap -> valueMap.each { runId, performativeCountMap ->
def sc = performativeCountMap.get(Performative.SUCCEED.toString()) as String def sc = performativeCountMap.get(Performative.SUCCEED.toString()) as String
sc=(sc!=null)?sc:0
def fl = performativeCountMap.get(Performative.FAIL.toString()) as String def fl = performativeCountMap.get(Performative.FAIL.toString()) as String
fl=(fl!=null)?fl:0
def cl = performativeCountMap.get(Performative.CANCEL.toString()) as String def cl = performativeCountMap.get(Performative.CANCEL.toString()) as String
cl=(cl!=null)?cl:0
def rf = performativeCountMap.get(Performative.REFUSE.toString()) as String def rf = performativeCountMap.get(Performative.REFUSE.toString()) as String
rf=(rf!=null)?rf:0
def acc = performativeCountMap.get(Performative.ACCEPT.toString()) as String def acc = performativeCountMap.get(Performative.ACCEPT.toString()) as String
acc=(acc!=null)?acc:0
def cnf = performativeCountMap.get(Performative.CONFIRM.toString()) as String def cnf = performativeCountMap.get(Performative.CONFIRM.toString()) as String
cnf=(cnf!=null)?cnf:0
def up = performativeCountMap.get(Performative.UPDATE.toString()) as String def up = performativeCountMap.get(Performative.UPDATE.toString()) as String
up = (up!=null)?up:0
def ob = performativeCountMap.get(Performative.OBLIGATION_MAINTAINED.toString()) as String def ob = performativeCountMap.get(Performative.OBLIGATION_MAINTAINED.toString()) as String
ob = (ob!=null)?ob:0
def dp = performativeCountMap.get(Performative.DEPENDENCY_MAINTAINED.toString()) as String def dp = performativeCountMap.get(Performative.DEPENDENCY_MAINTAINED.toString()) as String
dp = (dp!=null)?dp:0
writeme << "${approachName},${key},${runId},${sc},${fl},${cl},${rf},${acc},${cnf},${up},${ob},${dp}\n" writeme << "${approachName},${key},${runId},${sc},${fl},${cl},${rf},${acc},${cnf},${up},${ob},${dp}\n"
//need to retrieve values in fixed order of performative iterator, inserting 0 if no key is present! //need to retrieve values in fixed order of performative iterator, inserting 0 if no key is present!
} }
writeme << "average\nst.dev\n" writeme << "average\nst.dev\n"
} }
println "======================================================================================="
println "${writeme}"
println "======================================================================================="
writeToFile(loc, writeme) writeToFile(loc, writeme)
} }
void writeToFile(loc, data) { void writeToFile(loc, data) {
def target = new File(loc) println "Writing to ${loc}"
File target = new File(loc)
target.createNewFile()
println "Writing to ${loc}" println "Writing to ${loc}"
data.each { data.each {
println "Writing ${it}" println "Writing ${it}"
...@@ -118,8 +123,7 @@ class MessageStatsParser { ...@@ -118,8 +123,7 @@ class MessageStatsParser {
def lines = file.text.split('\n') def lines = file.text.split('\n')
List<String[]> rows = lines.collect {it.split(',')} List<String[]> rows = lines.collect {it.split(',')}
for(int i=0; i<rows[0].length; i++) { for(int i=0; i<rows[0].length; i++) {
println "Row:${rows[0][i].trim()} = ${rows[-1][i]}" contents[rows[0][i].trim()] = rows[-1][i].trim()
contents[rows[0][i].trim()] = rows[-1][i].trim()
} }
return contents return contents
} }
...@@ -136,6 +140,6 @@ class MessageStatsParser { ...@@ -136,6 +140,6 @@ class MessageStatsParser {
println "Root directory is \"$opt.r\"" println "Root directory is \"$opt.r\""
def parser = new MessageStatsParser(root:opt.r, approachName:opt.r) def parser = new MessageStatsParser(root:opt.r, approachName:opt.r)
parser.parseMessageStats() parser.parseMessageStats()
parser.writeOutResults("$opt.r/${opt.r}MsgStatsSummary.csv") parser.writeOutResults("$opt.r/MsgStatsSummary.csv")
} }
} }
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment