summaryrefslogtreecommitdiffstats
path: root/planetlab/plot.py
blob: b9d21156bd680a610a048a1555f4897a95919ecf (plain)
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
import os
projectdir ='/home/thibaut/pacemaker/planetlab/data'
result = [[]]
for node in os.listdir(projectdir):
    c = 0
    preuve = {}
    try:
        for logfile in os.listdir(os.path.join(projectdir,node,'log')):
            if '.net' in logfile:
                fh = open(os.path.join(projectdir,node,'log',logfile),"r")
                for line in fh:
                    tokens = line.split()
                    if tokens[1] > 0:
                        c+=1
                fh.close()
            if '.prot' in logfile:
                fh = open(os.path.join(projectdir,node,'log',logfile),"r")
                for line in fh:
                    if 'Proof' in line:
                        timestp, proof, nround, depth = line.rstrip().split()
                        preuve[nround]=1
                fh.close()
        result.append([node,c,len(preuve)])
        error = abs(c-len(preuve)*5.)/c
	print error
    except OSError:
        pass