Go to the documentation of this file.00001
00002 import pickle, os, sys
00003
00004
00005
00006
00007
00008 def optionParse():
00009 parser = opt.OptionParser()
00010 parser.add_option_group(devel)
00011 (options, args) = parser.parse_args()
00012
00013 if not len(args) == 1:
00014 parser.error("you must only pass one file as an argument")
00015 sys.exit()
00016
00017 datafile = os.path.abspath(args[0])
00018 if not os.path.isfile(datafile):
00019 parser.error("%s file does not exist" % datafile)
00020 sys.exit()
00021
00022 return datafile
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 def printBenchmarkData(afile):
00044 ph = open(afile,"rb")
00045 list = pickle.load(ph)
00046 ph.close()
00047 for host, data in list:
00048 try:
00049 for options, cpudata in data:
00050 for cpukey in cpudata:
00051 cpustr = ""
00052 if cpukey == "None":
00053 cpustr = "cpu: " + str(options["cpus"][0])
00054 else:
00055 cpustr = "cpu: " + str(cpukey)
00056 candledata = cpudata[cpukey]
00057 for candlekey in candledata:
00058 profsetdata = candledata[candlekey]
00059 for profsetkey in profsetdata:
00060 profiledata = profsetdata[profsetkey]
00061 for profilekey in profiledata:
00062 stepdata = profiledata[profilekey]
00063 for stepkey in stepdata:
00064 print "Host: " + str(host)
00065 print "Options: " + str(options)
00066 print cpustr
00067 print "candle: " + str(candlekey)
00068 print "profsetdata: " + str(profsetkey)
00069 print "profiler: " + str(profilekey)
00070 print "step: " + str(stepkey)
00071 for evtdat in stepdata[stepkey]:
00072 print evtdat
00073 except TypeError, detail:
00074 print "Data: does not exist for this machine, the server failed to return a valid data structure"
00075 print detail
00076
00077
00078 if __name__ == "__main__":
00079 datafile = optionParse()
00080 printBenchmarkData(datafile)