Exemplo n.º 1
0
def plotCQIThroughput():
    plot = Plot()

    plot.setXLimits(-10, 25)
    #    plot.setXLimits(5, 10)
    plot.setYLimits(0, 4.5)
    plot.setXLabel("SINR")
    plot.setYLabel("Throughput")

    #(plot.width, plot.height) = (16,9) # getGoldenRatioDimensions(35)

    fileName = "throughputsCQI"

    for cqi in range(1, 16): #1..15
        line = boomslang.Line()
        (line.xValues, line.yValues) = getXYfromFile(fileName+".txt", 0, cqi)
        #    print line.xValues, line.yValues
        if cqi==1:
            line.label = "QPSK"
        elif cqi==7:
            line.label = "16 QAM"
        elif cqi==10:
            line.label = "64 QAM"
            
        line.color = cqiStyles[cqi]['color']
        line.lineStyle = cqiStyles[cqi]['lineStyle']
        line.lineWidth = line.lineWidth * 3
        
        plot.add(line)
        
    plot.save(fileName+".pdf")
Exemplo n.º 2
0
def plotMCSThroughput():
    plot = Plot()

    plot.setXLimits(-10, 25)
    #    plot.setXLimits(5, 10)
    plot.setYLimits(0, 4.5)
    plot.setXLabel("SINR")
    plot.setYLabel("Throughput")

    #(plot.width, plot.height) = (16,9) # getGoldenRatioDimensions(35)

    fileName = "throughputsMCS"

    for mcs in range(29):
        line = boomslang.Line()
        (line.xValues, line.yValues) = getXYfromFile(fileName+".txt", 0, mcs + 1)
        #    print line.xValues, line.yValues
        if mcs==0:
            line.label = "QPSK"
        elif mcs==10:
            line.label = "16 QAM"
        elif mcs==17:
            line.label = "64 QAM"
            
        line.color = mcsStyles[mcs]['color']
        line.lineStyle = mcsStyles[mcs]['lineStyle']
        line.lineWidth = line.lineWidth * 3
        
        plot.add(line)
        
    plot.save(fileName+".pdf")
Exemplo n.º 3
0
def main(argv):
    # Parse flags
    args = parser.parse_args()

    expt_dirs_2000 = ['../test_scripts/nsdi-paper-data/Sep21--10-34-combine/memcached-rl-htb-mcrate-2000-mctenants-10-trafgentenants-0-run-1/',
                      '../test_scripts/nsdi-paper-data/Sep21--10-34-combine/memcached-rl-qfq-mcrate-2000-mctenants-10-trafgentenants-0-run-1/',
                      '../test_scripts/nsdi-paper-data/Sep21--10-34-combine/memcached-rl-eyeq-mcrate-2000-mctenants-10-trafgentenants-0-run-1/']

    expt_dirs_3000 = ['../test_scripts/nsdi-paper-data/Sep21--10-34-combine/memcached-rl-htb-mcrate-3000-mctenants-10-trafgentenants-0-run-1/',
                      '../test_scripts/nsdi-paper-data/Sep21--10-34-combine/memcached-rl-qfq-mcrate-3000-mctenants-10-trafgentenants-0-run-1/',
                      '../test_scripts/nsdi-paper-data/Sep21--10-34-combine/memcached-rl-eyeq-mcrate-3000-mctenants-10-trafgentenants-0-run-1/']

    # Read the properties for each directory from the expsift tags files
    dir2props_dict_2000 = getDir2PropsDict(expt_dirs_2000)
    dir2props_dict_3000 = getDir2PropsDict(expt_dirs_3000)

    # Plot memcached latency comparison graph (msec)
    mclat_plot_2000 = plotMcperfLatencyCDFComparisonDirs(dir2props_dict_2000)
    mclat_plot_3000 = plotMcperfLatencyCDFComparisonDirs(dir2props_dict_3000)

    # Specify the xTicks values to display
    ticklabels_line_2000 = boomslang.Line()
    ticklabels_line_2000.xTickLabels = [0.5, 1.0, 1.5]
    ticklabels_line_2000.xTickLabelPoints = [0.5, 1.0, 1.5]
    mclat_plot_2000.add(ticklabels_line_2000)
    ticklabels_line_3000 = boomslang.Line()
    ticklabels_line_3000.xTickLabels = [0.5, 1.0, 1.5]
    ticklabels_line_3000.xTickLabelPoints = [0.5, 1.0, 1.5]
    mclat_plot_3000.add(ticklabels_line_3000)

    # Set title and legend
    mclat_plot_2000.title = "2000 rpstc"
    mclat_plot_3000.title = "3000 rpstc"
    mclat_plot_3000.setYLabel('')
    mclat_plot_3000.legend = None
    mclat_plot_2000.hasLegend(location="lower right")
    mclat_plot_2000.setLegendLabelSize("small")

    # Plot layout
    layout = boomslang.PlotLayout()
    layout.addPlot(mclat_plot_2000, grouping='lat_cdfs')
    layout.addPlot(mclat_plot_3000, grouping='lat_cdfs')
    layout.setFigureDimensions(5, 3)

    # Save the plot
    layout.save(args.plot_filename)
    return
Exemplo n.º 4
0
def plotMCSEfficiency():
    plot = Plot()

    plot.setXLimits(-10, 25)
    #    plot.setXLimits(5, 10)
    plot.setYLimits(0, 6)
    plot.setXLabel("SINR")
    plot.setYLabel("Spectral Efficiency [bits / s / Hz]")

    #(plot.width, plot.height) = (16,9) # getGoldenRatioDimensions(35)

    fileName = "efficienciesMCS"

    for mcs in range(29):
        line = boomslang.Line()
        (line.xValues, line.yValues) = getXYfromFile(fileName+".txt", 0, mcs + 1)
        #    print line.xValues, line.yValues
        if mcs==0:
            line.label = "QPSK"
        elif mcs==10:
            line.label = "16 QAM"
        elif mcs==17:
            line.label = "64 QAM"
            
        line.color = mcsStyles[mcs]['color']
        line.lineStyle = mcsStyles[mcs]['lineStyle']
        line.lineWidth = line.lineWidth * 3
        
        plot.add(line)

    shannon = boomslang.Line()
    shannon.xValues = [x / 10 - 10 for x in range(350)]
    shannon.yValues = [math.log(math.pow(10.0, x/10.0) + 1.0, 2.0) for x in shannon.xValues]
    shannon.label = "Shannon Capacity"
    plot.add(shannon)

    # shannon60 = boomslang.Line()
    # shannon60.xValues = [x / 10 - 10 for x in range(350)]
    # shannon60.yValues = [0.6 * math.log(math.pow(10.0, x/10.0) + 1.0, 2.0) for x in shannon60.xValues]
    # shannon60.label = "60% of Shannon Capacity"
    # plot.add(shannon60)

        
    plot.save(fileName+".pdf")
Exemplo n.º 5
0
def cdfLineFromHist(hist, color="blue", width=2):
    sorted_hist = sorted(hist.items())
    cum_sum = numpy.cumsum(map(lambda (k, v): v, sorted_hist))
    num_samples = cum_sum[-1]

    cdf_line = boomslang.Line(color=color, width=width)
    cdf_line.xValues = map(lambda (k, v): k, sorted_hist)
    cdf_line.yValues = map(lambda y: y * 1.0 / num_samples, cum_sum)

    return cdf_line
Exemplo n.º 6
0
def plotCQIEfficiency():
    plot = Plot()

    plot.setXLimits(-10, 25)
    #    plot.setXLimits(5, 10)
    plot.setYLimits(0, 6.0)
    plot.setXLabel("SINR")
    plot.setYLabel("Spectral Efficiency [bits / s / Hz]")

    #(plot.width, plot.height) = (16,9) # getGoldenRatioDimensions(35)

    fileName = "efficienciesCQI"

    for cqi in range(1, 16): #1..15
        line = boomslang.Line()
        (line.xValues, line.yValues) = getXYfromFile(fileName+".txt", 0, cqi)
        #    print line.xValues, line.yValues
        if cqi==1:
            line.label = "QPSK"
        elif cqi==7:
            line.label = "16 QAM"
        elif cqi==10:
            line.label = "64 QAM"
            
        line.color = cqiStyles[cqi]['color']
        line.lineStyle = cqiStyles[cqi]['lineStyle']
        line.lineWidth = line.lineWidth * 3
        
        plot.add(line)

    shannon = boomslang.Line()
    shannon.xValues = [x / 10 - 10 for x in range(350)]
    shannon.yValues = [math.log(math.pow(10.0, x/10.0) + 1.0, 2.0) for x in shannon.xValues]
    shannon.label = "Shannon Capacity"
    plot.add(shannon)
    
        
    plot.save(fileName+".pdf")
def main(argv):
    # Parse flags
    args = parser.parse_args()

    # Generate the list of experiment directories to compare
    expt_dirs = []
    if args.recursive:
        for directory in args.expt_dirs:
            directory = os.path.abspath(directory)
            for (path, dirs, files) in os.walk(directory, followlinks=True):
                # Check if an experiment directory was found
                if os.path.exists(os.path.join(path, 'expsift_tags')):
                    #print 'Found experiment directory:', path
                    expt_dirs.append(path)
        print 'Found %d experiment directories to compare' % len(expt_dirs)
    else:
        expt_dirs = args.expt_dirs

    # Check if any experiment directories were found or not
    if len(expt_dirs) == 0:
        return

    # Read the properties for each directory from the expsift tags files
    dir2props_dict = getDir2PropsDict(expt_dirs)

    # Plot trafgen throughput comparison graph
    trafgenrate_plot = plotTrafgenThroughputComparisonDirs(dir2props_dict)

    if FOR_PAPER:
        # Set xLabel
        trafgenrate_plot.setXLabel("Load (rpstc)")

        # Tick labels
        xmin, xmax = LOAD_LIMITS
        xTickLabels = range(xmin, xmax + 1, 1000)
        ticklabels_line = boomslang.Line()
        ticklabels_line.xTickLabels = xTickLabels
        ticklabels_line.xTickLabelPoints = xTickLabels
        trafgenrate_plot.add(ticklabels_line)

        # Label sizes
        trafgenrate_plot.setXTickLabelSize("small")
    trafgenrate_plot.save(args.plot_filename)
Exemplo n.º 8
0
def main(argv):
    # Parse flags
    args = parser.parse_args()

    if args.dataset == 0:
        expt_dirs_base = [
            '../test_scripts/nsdi-paper-data/Sep21--10-34-combine/'
        ]
        plotMcperfLatencyCompare.LOAD_LIMITS = (1000, 7000)
    elif args.dataset == 1:
        expt_dirs_base = [
            '../test_scripts/nsdi-paper-data/Sep20--07-02-iso-combine/'
        ]
        plotMcperfLatencyCompare.LOAD_LIMITS = (1000, 5000)
    else:
        print 'Unknown dataset'
        return

    expt_dirs = []
    for directory in expt_dirs_base:
        directory = os.path.abspath(directory)
        for (path, dirs, files) in os.walk(directory, followlinks=True):
            # Check if an experiment directory was found
            if os.path.exists(os.path.join(path, 'expsift_tags')):
                #print 'Found experiment directory:', path
                expt_dirs.append(path)
    print 'Found %d experiment directories to compare' % len(expt_dirs)

    # Read the properties for each directory from the expsift tags files
    dir2props_dict = getDir2PropsDict(expt_dirs)

    # Plot memcached latency comparison graphs (msec)
    avg_plot = plotMcperfLatencyComparisonDirsWrapper(dir2props_dict, 'avg')
    pc99_plot = plotMcperfLatencyComparisonDirsWrapper(dir2props_dict, 'pc99')
    pc999_plot = plotMcperfLatencyComparisonDirsWrapper(
        dir2props_dict, 'pc999')

    # Set xLabel
    avg_plot.setXLabel("Load (rpstc)")
    pc99_plot.setXLabel("Load (rpstc)")
    pc999_plot.setXLabel("Load (rpstc)")

    # Set yLabel
    avg_plot.setYLabel("Latency (msec)")
    pc99_plot.setYLabel("Latency (msec)")
    pc999_plot.setYLabel("Latency (msec)")

    # Title
    avg_plot.title = "Average"
    pc99_plot.title = "99th percentile"
    pc999_plot.title = "99.9th percentile"

    # Tick labels
    xmin, xmax = plotMcperfLatencyCompare.LOAD_LIMITS
    xTickLabels = range(xmin, xmax + 1, 1000)
    ticklabels_line = boomslang.Line()
    ticklabels_line.xTickLabels = xTickLabels
    ticklabels_line.xTickLabelPoints = xTickLabels
    avg_plot.add(ticklabels_line)
    pc99_plot.add(ticklabels_line)
    pc999_plot.add(ticklabels_line)

    # Label sizes
    avg_plot.setXTickLabelSize("small")
    pc99_plot.setXTickLabelSize("small")
    pc999_plot.setXTickLabelSize("small")
    avg_plot.setYTickLabelSize("small")
    pc99_plot.setYTickLabelSize("small")
    pc999_plot.setYTickLabelSize("small")
    avg_plot.setTitleSize("small")
    pc99_plot.setTitleSize("small")
    pc999_plot.setTitleSize("small")

    # Plot layout
    layout = boomslang.PlotLayout()
    layout.addPlot(avg_plot, grouping='throuput')
    layout.addPlot(pc99_plot, grouping='throuput')
    layout.addPlot(pc999_plot, grouping='throuput')
    layout.setFigureDimensions(13.5, 3)

    # Save the plot
    layout.save(args.plot_filename)
    return
Exemplo n.º 9
0
def plotLineComparisonDirs(
        dir2props_dict,  # dict
        xgroup_props,  # list. Props to group along x axis
        line_props,  # list. Properties of line
        fn_sort_lines,
        fn_get_line_label,
        fn_get_xgroup_value,  # xValue. No separate label
        fn_get_datapoint,  # yValue
        xLabel,
        yLabel,
        title,
        xLimits=None,
        yLimits=None,
        for_paper=False):

    # 1. Turn each directory's set of prop=val strings into a dictionary to
    #     easily look up the value of a particular property for the directory
    dir2prop2val_dict = getDir2Prop2ValDict(dir2props_dict)

    # 2. Find all the common and unique properties among all directories
    common_props, unique_props = getCommonAndUniqueProperties(dir2props_dict)

    # 3A. Find all unique values of line properties (each is separate line)
    line2dir_dict = getDirGroupsByProperty(dir2props_dict,
                                           line_props,
                                           ignore=False)
    unique_lines = line2dir_dict.keys()
    # 3B. Sort the lines
    fn_sort_lines(unique_lines)

    # 4. Find all unique values of the xgroup properties
    xgroup2dir_dict = getDirGroupsByProperty(dir2props_dict,
                                             xgroup_props,
                                             ignore=False)
    unique_xgroups = xgroup2dir_dict.keys()

    # 5. For each unique line,
    #    For each unique xgroup,
    #        Create an individual datapoints list
    datapoints_dict = {}
    for line in unique_lines:
        datapoints_dict[line] = {}
        for xgroup in unique_xgroups:
            datapoints_dict[line][xgroup] = []

    # 6. Visit each directory and populate the corresponding datapoints list for
    #    that directory.
    for directory, prop_vals in dir2props_dict.iteritems():
        # Find the line and xgroup of the directory
        line = onlyIncludeProps(prop_vals, line_props)
        xgroup = onlyIncludeProps(prop_vals, xgroup_props)

        # Compute the datapoint for the directory
        datapoint = fn_get_datapoint(directory)

        # Add the data point
        datapoints_dict[line][xgroup].append(datapoint)

    # 7. For each unique line prop, create a line.
    #    Set the label and color for the line
    colors = ('b', 'g', 'r', 'm', 'c', 'y')
    all_lines_dict = {}
    for index, line in enumerate(unique_lines):
        l = boomslang.Line()
        l.color = colors[index % len(colors)]
        l.label = fn_get_line_label(line)
        l.width = 2
        l.marker = 'o'
        all_lines_dict[line] = l

    # 8. Compute average and stddev for each (line, xgroup) combination. This
    #    represents the avg and stddev across multiple trials.
    #    Add these to the corresponding lines.
    for line, line_dict in datapoints_dict.iteritems():
        for xgroup, datapoints in line_dict.iteritems():
            avg = numpy.average(datapoints)
            stddev = numpy.std(datapoints)

            # Append xValue, yValue, yError to the line
            xValue = fn_get_xgroup_value(xgroup)
            all_lines_dict[line].xValues.append(xValue)
            all_lines_dict[line].yValues.append(avg)
            all_lines_dict[line].yErrors.append(stddev)

    # 9. Create the plot and add all the lines
    plot = boomslang.Plot()
    for line in unique_lines:
        plot.add(all_lines_dict[line])

    # 9A. Set title and axes labels
    plot.setXLabel(xLabel)
    plot.setYLabel(yLabel)
    plot.setTitle(title)
    plot.hasLegend()

    # 9B. Font size
    plot.setLegendLabelSize("small")
    plot.setTitleSize("small")
    plot.setAxesLabelSize("small")
    plot.setXTickLabelSize("small")
    plot.setYTickLabelSize("small")

    # 9C. Grid
    plot.grid.color = "lightgray"
    plot.grid.style = "dotted"
    plot.grid.lineWidth = 0.8
    plot.grid.visible = True

    # 9D. xLimits, yLimits
    if xLimits:
        plot.xLimits = xLimits
    if yLimits:
        plot.yLimits = yLimits

    # 10. Set dimensions of the plot
    if for_paper:
        plot.setDimensions(width=4.5)

    # 11. Return the plot
    return plot