-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProcessResultsAttrs.py
More file actions
executable file
·58 lines (44 loc) · 1.69 KB
/
ProcessResultsAttrs.py
File metadata and controls
executable file
·58 lines (44 loc) · 1.69 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
#!/usr/bin/python
import os
from processAFileOutOfOrder import processFile
from mystat import get_stats_with_names
dirName = '/Users/ayadav/Documents/GNS/ContextServiceExpScripts/attrsResults/updateResultsvsAttrsLowLoad2'
fileList = os.listdir(dirName)
print fileList
writef = open("UPTvsAttrs.csv", "w")
value_dict = {}
for x in fileList:
if ( x == '.svn'):
continue
fI = x.find('scheme',0)
sI = x.find('attrNum',0)
schemeTypeString = x[fI+7:fI+8 ]
attrNumString = x[sI+8:]
print x+' '+schemeTypeString+' '+attrNumString
currList = processFile(dirName+'/'+x, 'UPDATEFROMUSER REQUEST', 'UPDATEFROMUSERREPLY REQUEST')
if (not value_dict.has_key(int(attrNumString)) ):
schemeTypeDict = {}
meanList = []
meanList.append(currList['mean'])
schemeTypeDict[int(schemeTypeString)] = meanList
value_dict[int(attrNumString)] = schemeTypeDict
else:
exptTypeDict = value_dict[int(attrNumString)]
if (not exptTypeDict.has_key(int(schemeTypeString)) ):
meanList = []
meanList.append(currList['mean'])
exptTypeDict[int(schemeTypeString)] = meanList
else:
exptTypeDict[int(schemeTypeString)].append(currList['mean'])
#if ( not statDict.has_key('ZEROVALUES') ):
Keys=sorted(value_dict.keys())
for attr in Keys:
exptTypeDict = value_dict[attr]
writeStr=str(attr)
stKeys=sorted(exptTypeDict.keys())
for st in stKeys:
res=get_stats_with_names(exptTypeDict[st])
writeStr+=','+str(st)+','+str(res['mean'])+','+str(res['perc5'])+','+str(res['perc95'])
writeStr+="\n"
writef.write(writeStr)
writef.close()