コード例 #1
0
ファイル: fct_process.py プロジェクト: keqhe/phd_thesis
def parse_lat(args):
    latencyTimes = []
    verbose = 0
    for line in args.file:
	    line = line[:-1]
            try:
                #the latency is RTT, so have to divide by 2 to get one way
                latency = float(line)*1000

                #let's just get usec, and round off
                #print line
                #print latency
                #print int(latency)
                
                #store in array
                latencyTimes.append(latency)


            except:
                continue

                
    #make cdf
    sto = "%s.cdf"%(args.file.name)
    cdfTimes = create_cdf.create_cdf(latencyTimes)
    cdfTimes.cdf(sto, verbose)
コード例 #2
0
def parse_lat(args):
    latencyTimes = []
    verbose = 0
    for line in args.file:
        match = re.match("(.*), (.*)", line)
        if (match):
            try:
                #the latency is RTT, so have to divide by 2 to get one way
                latency = (float(match.group(2)) - float(match.group(1)))

                #let's just get usec, and round off
                latency = latency * 1000000
                #print line
                #print latency
                #print int(latency)

                #store in array
                latencyTimes.append(int(latency))

            except:
                continue

    #make cdf
    sto = "%s.cdf" % (args.file.name)
    cdfTimes = create_cdf.create_cdf(latencyTimes)
    cdfTimes.cdf(sto, verbose)
コード例 #3
0
ファイル: parse-and-plot.py プロジェクト: cwz920716/myapp
    
afile.close()

#
# output file names
#
sto = "%s/workloadTimes"%(store)
fto = "%s/flowTimes"%(store)
fmo = "%s/flowMbps"%(store)

#
# now we have our data, let's get CDFs
#
if (verbose):
    print "Workload CDF"
cdfWorkloadTimes = create_cdf.create_cdf(workloadTimes)
cdfWorkloadTimes.cdf(sto, verbose)

if (verbose):
    print "Flow times CDF"
cdfFlowTimes = create_cdf.create_cdf(flowTimes)
cdfFlowTimes.cdf(fto, verbose)

if (verbose):
    print "Flow Mbps CDF"
cdfFlowMbps = create_cdf.create_cdf(flowMbps)
cdfFlowMbps.cdf(fmo, verbose)


#
# CDFs are generated, let's plot them now
コード例 #4
0
ファイル: plot_cdf.py プロジェクト: cwz920716/myapp
xlabel = sys.argv[3]

# queue counter: The counter for measuring how many http requests are on the fly
datapoints = []
linecnt = 0

for lines in file:
	if lines[0] == '#':
		continue
	# print lines
	linecnt = linecnt + 1
	tuples = lines.split()
	if len(tuples) < index:
		index = len(tuples) - 1
	datapoints.append(float(tuples[index]))

file.close()

verbose = 1
sto = sys.argv[1] + '.cdf'

dps = create_cdf.create_cdf(datapoints)
dps.cdf(sto, verbose)


#
# CDFs are generated, let's plot them now
#
pltSt = create_gnuplot.create_gnuplot(sto)
pltSt.plot_many_plots(xlabel, "Fraction", [sto])