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 {
}
resultSet[dir.name] = approachResults
}
println "End results\n$resultSet"
}
void writeOutResults(loc) {
......@@ -61,34 +60,40 @@ class MessageStatsParser {
writeme << "ndebil,approach,run,${postFix}\n" //header
//each entry by key in map
println "map is $resultSet"
// println "map is $resultSet"
resultSet.each { key, valueMap ->
println "KEY: ${key}"
// println "KEY: ${key}"
valueMap.each { runId, performativeCountMap ->
def sc = performativeCountMap.get(Performative.SUCCEED.toString()) as String
sc=(sc!=null)?sc:0
def fl = performativeCountMap.get(Performative.FAIL.toString()) as String
fl=(fl!=null)?fl:0
def cl = performativeCountMap.get(Performative.CANCEL.toString()) as String
cl=(cl!=null)?cl:0
def rf = performativeCountMap.get(Performative.REFUSE.toString()) as String
rf=(rf!=null)?rf:0
def acc = performativeCountMap.get(Performative.ACCEPT.toString()) as String
acc=(acc!=null)?acc:0
def cnf = performativeCountMap.get(Performative.CONFIRM.toString()) as String
cnf=(cnf!=null)?cnf:0
def up = performativeCountMap.get(Performative.UPDATE.toString()) as String
up = (up!=null)?up:0
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
dp = (dp!=null)?dp:0
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!
}
writeme << "average\nst.dev\n"
}
println "======================================================================================="
println "${writeme}"
println "======================================================================================="
}
writeToFile(loc, writeme)
}
void writeToFile(loc, data) {
def target = new File(loc)
println "Writing to ${loc}"
File target = new File(loc)
target.createNewFile()
println "Writing to ${loc}"
data.each {
println "Writing ${it}"
......@@ -118,8 +123,7 @@ class MessageStatsParser {
def lines = file.text.split('\n')
List<String[]> rows = lines.collect {it.split(',')}
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
}
......@@ -136,6 +140,6 @@ class MessageStatsParser {
println "Root directory is \"$opt.r\""
def parser = new MessageStatsParser(root:opt.r, approachName:opt.r)
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