diff options
Diffstat (limited to 'planetlab/plot.py')
| -rw-r--r-- | planetlab/plot.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/planetlab/plot.py b/planetlab/plot.py index 463aca8..e13a718 100644 --- a/planetlab/plot.py +++ b/planetlab/plot.py @@ -1,5 +1,5 @@ import os -projectdir ='/home/thibaut/projects/pacemaker/planetlab/data' +projectdir ='/home/thibaut/pacemaker/planetlab/data' result = [[]] for node in os.listdir(projectdir): c = 0 @@ -8,19 +8,20 @@ for node in os.listdir(projectdir): 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()) + 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.readlines(): + for line in fh: if 'Proof' in line: - try: - timestp, proof, nround, depth = line.rstrip().split() - preuve[nround]=1 - except ValueError: - import pdb;pdb.set_trace() + timestp, proof, nround, depth = line.rstrip().split() + preuve[nround]=1 fh.close() - result.append([node,c,len(preuve)]) + result.append([node,c,len(preuve)]) + print abs(c-len(preuve)*5.)/c except OSError: pass |
