summaryrefslogtreecommitdiffstats
path: root/planetlab/plot.py
blob: 463aca87776097bb1c5324ebd7b3ce15fd64d475 (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
import os
projectdir ='/home/thibaut/projects/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")
                c += len(fh.readlines())
                fh.close()
            if '.prot' in logfile:
                fh = open(os.path.join(projectdir,node,'log',logfile),"r")
                for line in fh.readlines():
                    if 'Proof' in line:
                        try:
                            timestp, proof, nround, depth = line.rstrip().split()
                            preuve[nround]=1
                        except ValueError:
                            import pdb;pdb.set_trace()
                fh.close()
        result.append([node,c,len(preuve)]) 
    except OSError:
        pass