Ejemplo n.º 1
0
    def getTextReport(tresults):
        rtn = ""
        rtn += "%s, FINISHED with %s users on %s items in %0.2fs\nFinished @ %s\n"%(
            tresults['TNAME'], tresults['USERS'], len(tresults['ITEMS']), tresults['TIME'], time.asctime())
        for step in serverDict.keys():
            rtn += "\n%s used %d times.\n"%(step, serverDict[step])
        rtn += "-"*70
        
        averages = {
            'min':0, 'max':0, 'avg':0
        }
        
        for step in sorted(pDict.keys()):
            c = pDict[step]
            rtn += "\n%s \n\tmin:%0.3fs \tavg:%0.3fs \tmax:%0.3fs"%(step, smin(c), savg(c), smax(c))
            averages['min'] += smin(c)
            averages['avg'] += savg(c)
            averages['max'] += smax(c)
            
        a = len(pDict.keys())
            
        rtn += "\n\n\n\tmin:%0.3fs \tavg:%0.3fs \tmax:%0.3fs\n"%(averages['min']/a, averages['avg']/a, averages['max']/a)
       
        rtn += "\n\nBandwidth accumulated\n"
        rtn += "-"*70
        
        averages = {
            'up':0, 'down':0
        }
        
        for step in sorted(trafficDict.keys()):
            rtn += "\n%s \n\tdownload:%9s \tupload:%9s"%(step, conversions.convert_bytes(trafficDict[step]['download']), conversions.convert_bytes(trafficDict[step]['upload']))
            averages['up'] += trafficDict[step]['upload']
            averages['down'] += trafficDict[step]['download']
        
        rtn += '\n\n\n\tdownload:%9s \tupload:%9s\n'%(conversions.convert_bytes(averages['down']), conversions.convert_bytes(averages['up']))
        
        rtn += "\n\nKnown errors\n"
        rtn += "-"*70
        total = 0
        for step in sorted(errorDict.keys()):
            rtn += "\n%25s count: %d"%(step, errorDict[step])
            total += errorDict[step]
            
        rtn += "\nTotal:%d"%(total)
        
        rtn += "\n\nItems used: \n"
        rtn += "-"*70
        for step in tresults['ITEMS']:
            rtn += "\n" + str(step)

        return rtn
Ejemplo n.º 2
0
    def statit():
        print "~%d / %d"%(queue.qsize(), len(totalFiles))
        if running: threading.Timer(poll, statit).start()
        for k in pDict.keys():
            c = graphData.setdefault(k, {
                    'gMax':[], 'gAvg':[], 'cMin':[], 'cMax':[]
            })

            c['gMax'].append(smax(pDict[k])) #graph max
            c['gAvg'].append(savg(pDict[k])) #graph average
            c['cMin'].append(smin(cycleDict[k])) #cycle minimum
            c['cMax'].append(smax(cycleDict[k])) #cycle max
        #clear cycle statistics
        for k in cycleDict.keys():
            pDict[k] = pDict[k]+cycleDict[k]
            cycleDict[k] = []
Ejemplo n.º 3
0
 def getTextReport(tresults):
     rtn = ""
     rtn += "Test:%s, FINISHED with %s users on %s items in %0.2fs\n Finished@%s\n"%(
         tresults['TNAME'], tresults['USERS'], len(tresults['ITEMS']), tresults['TIME'], time.asctime())
     for step in serverDict.keys():
         rtn += "\n%25s, %d users."%(step, serverDict[step])
     rtn += "\n"
     for step in pDict.keys():
         c = pDict[step]
         rtn += "\n%25s, \tmin:%0.3fs \tavg:%0.3fs \tmax:%0.3fs"%(step, smin(c), savg(c), smax(c))
     rtn += "\n\nBandwidth accumulated\n"
     for step in trafficDict.keys():
         rtn += "\n%25s, \tdownload:%20s \tupload:%20s"%(step, conversions.convert_bytes(trafficDict[step]['download']), conversions.convert_bytes(trafficDict[step]['upload']))
     rtn += "\n\nKnown errors\n"
     for step in errorDict.keys():
         rtn += "\n%25s, count: %d"%(step, errorDict[step])
     return rtn