-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProcessResultsWithGNS.py
More file actions
executable file
·127 lines (103 loc) · 3.37 KB
/
ProcessResultsWithGNS.py
File metadata and controls
executable file
·127 lines (103 loc) · 3.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/usr/bin/python
import os
from QueryTimeProcessingGNS import queryProcess
from UpdateTimeProcessingGNS import updateProcess
from mystat import get_stats_with_names
dirName = '/home/adipc/Documents/ContextServiceExperiments/LoadExpGNS/TimevsLoadResultsv2'
fileList = os.listdir(dirName)
print fileList
#value_dict = {}
#loadIndex = {}
#loadIndex['10-2'] = 10
#loadIndex['20-4'] = 20
#loadIndex['30-6'] = 30
#loadIndex['40-8'] = 40
#loadIndex['50-10'] = 50
updateMap = {}
queryMap = {}
for x in fileList:
if ( x == '.svn'):
continue
if ( x.startswith('writerOutput')):
continue
fI = x.find('-',0)
sI = x.find('-',fI+1)
tI = x.find('-',sI+1)
fTI = x.find('-',tI+1)
ffI = x.find('-',fTI+1)
sxI = x.find('-',ffI+1)
svI = x.find('-',sxI+1)
etI = x.find('-', svI+1)
ntI = x.find('-', etI+1)
tnI = x.find('-', ntI+1)
elI = x.find('-', tnI+1)
twI = x.find('-', elI+1)
#queryOrUpdate = x[0:fI]
schemeTypeString = x[sI+1:tI]
reqpsString = x[fTI+1:ffI]
ratioString = x[sxI+1:svI]
guidString = x[twI+1:]
key = reqpsString+'-'+ratioString+'-'+guidString
print x+' '+schemeTypeString+' '+reqpsString+' '+ratioString+' '+guidString
#if(queryOrUpdate == 'queryOutput'):
currList = queryProcess(dirName+'/'+x)
if ( currList.has_key('ZEROVALUES') ):
currList['mean'] = 0
print "\n\n zero found \n\n"
if (not queryMap.has_key(key) ):
exptTypeDict = {}
meanList = []
meanList.append(currList['mean'])
exptTypeDict[schemeTypeString] = meanList
queryMap[key] = exptTypeDict
else:
exptTypeDict = queryMap[key]
if (not exptTypeDict.has_key(schemeTypeString) ):
meanList = []
meanList.append(currList['mean'])
exptTypeDict[schemeTypeString] = meanList
else:
exptTypeDict[schemeTypeString].append(currList['mean'])
#elif (queryOrUpdate == 'updateOutput'):
currList = updateProcess(dirName+'/'+x)
if ( currList.has_key('ZEROVALUES') ):
currList['mean'] = 0
print "\n\n zero found \n\n"
if (not updateMap.has_key(key) ):
exptTypeDict = {}
meanList = []
meanList.append(currList['mean'])
exptTypeDict[schemeTypeString] = meanList
updateMap[key] = exptTypeDict
else:
exptTypeDict = updateMap[key]
if (not exptTypeDict.has_key(schemeTypeString) ):
meanList = []
meanList.append(currList['mean'])
exptTypeDict[schemeTypeString] = meanList
else:
exptTypeDict[schemeTypeString].append(currList['mean'])
#if ( not statDict.has_key('ZEROVALUES') ):
#print value_dict
writef = open("QPT.csv", "w")
Keys=sorted(queryMap.keys())
for ui in Keys:
exptTypeDict = queryMap[ui]
writeStr=str(ui)
for st in exptTypeDict:
res=get_stats_with_names(exptTypeDict[st])
writeStr+=','+str(st)+','+str(res['mean'])
writeStr+="\n"
writef.write(writeStr)
writef.close()
writef = open("UPT.csv", "w")
Keys=sorted(updateMap.keys())
for ui in Keys:
exptTypeDict = updateMap[ui]
writeStr=str(ui)
for st in exptTypeDict:
res=get_stats_with_names(exptTypeDict[st])
writeStr+=','+str(st)+','+str(res['mean'])
writeStr+="\n"
writef.write(writeStr)
writef.close()