Revision 1 -
(download)
(as text)
(annotate)
Mon Aug 27 11:46:35 2012 UTC
(11 years, 10 months ago)
by agomez File size: 1622 byte(s)
'''
Created on 06/02/2012
@author: R. Valin
'''
import os
def s_time(time,level):
# locations='fr-inria'
# storage='@BonFIRE Debian Squeeze 2G v3'
# instance='lite'
# time=dict()
# time['broker']=1
dire = os.getcwd()
d = os.path.dirname(dire+'/output/')
#print 'instance', instance
print dire+'/output/'
if not os.path.exists(d):
os.makedirs(d)
file1 = open(d +'/time_cluster'+str(os.getpid())+'.csv', 'a')
file1.write(level+','+str(time)+'\n')
file1.close()
def st_cluster(sub_time,stats,iter,location,uris):
#stats
dire = os.getcwd()
d = os.path.dirname(dire+'/output/'+location+'/')
print dire+'/output/'+location+'/'
if not os.path.exists(d):
os.makedirs(d)
file1 = open(d + '/time_cluster'+str(os.getpid())+'.csv', 'a')
#Here we print the head of the file of the first experiment
if iter is 0:
for i in stats:
print i+'\t'+str(stats[str(i)])
file1.write(i+'\t')
file1.write(i+'\n')
#Here we print stats
file1.write(str(sub_time)+'\t')
for j in stats:
file1.write(str(stats[str(j)])+'\t')
for m in uris:
print m
file1.write(m+'\t')
file1.write('\n')
file1.close()
#mm=simplejson.dumps(jdata.decode(kk)['resources'])
#jdata= json.JSONDecoder()
#for i in jdata.decode(mm):
#kk=(mm)
#for j in mm:
# print j.
# for j in [i['resources']]:
# print j.split(',')