コード例 #1
0
def network_optimization_plot(dir: str, graphs: List[Any]) -> None:
    df_all = read_iperf(
        os.path.join(os.path.realpath(dir), "iperf-all-on-latest.tsv"),
        "offloads+\nzerocopy")

    df_offload = read_iperf(
        os.path.join(os.path.realpath(dir), "iperf-offload_off-latest.tsv"),
        "no offloads")

    df_zcopy = read_iperf(
        os.path.join(os.path.realpath(dir), "iperf-zerocopy_off-latest.tsv"),
        "no zerocopy")
    df = pd.concat([df_all, df_offload, df_zcopy])
    g = catplot(
        data=apply_aliases(df),
        x=column_alias("type"),
        y=column_alias("iperf-throughput"),
        kind="bar",
        height=2.5,
        # aspect=1.2,
        color="black",
        palette=None,
    )
    apply_to_graphs(g.ax, False, -1, 0.18)

    graphs.append(g)
コード例 #2
0
def mysql_throughput_graph(df: pd.DataFrame) -> Any:
    df = df[["system", "SQL statistics transactions", "General statistics total time"]]
    df["General statistics total time"] = df["General statistics total time"].apply(
        lambda x: float(x.replace("s", ""))
    )
    df["mysql-throughput"] = (
        df["SQL statistics transactions"] / df["General statistics total time"]
    )

    df = apply_aliases(df)

    g = catplot(
        data=df,
        x=column_alias("system"),
        y=column_alias("mysql-throughput"),
        kind="bar",
        height=2.5,
        # aspect=1.2,
        color=color,
        palette=None,
        order=systems_order(df),
    )

    apply_to_graphs(g.ax, False, -1, 0.285)
    return g
コード例 #3
0
def nginx_graph(df: pd.DataFrame, metric: str) -> Any:
    plot_col = ["system"]
    thru_ylabel = None
    width = None

    if metric == "lat":
        plot_col.append("lat_avg(ms)")
        width = 0.25
    elif metric == "thru":
        plot_col.append("req_sec_tot")
        width = 0.3

    plot_df = df[plot_col]

    groups = len(set((list(plot_df["system"].values))))
    plot_df = apply_aliases(plot_df)

    g = catplot(data=plot_df,
                x=plot_df.columns[0],
                y=plot_df.columns[1],
                kind="bar",
                order=systems_order(plot_df),
                height=2.5,
                legend=False,
                palette=None,
                color="black"
                # aspect=1.2,
                )
    apply_to_graphs(g.ax, False, -1, width)
    if metric == "thru":
        thru_ylabel = g.ax.get_yticklabels()
        thru_ylabel = [str(int(int(x.get_text()))) for x in thru_ylabel]
        thru_ylabel[0] = "0"
        g.ax.set_yticklabels(thru_ylabel)
    return g
コード例 #4
0
def syscalls_perf_graph(df: pd.DataFrame) -> Any:
    df2 = df[(df.data_size == 32) & (df.threads == 8)]
    df2 = df2.assign(
        time_per_syscall=10e6 * df2.total_time / (df2.packets_per_thread * df2.threads)
    )
    g = catplot(
        data=apply_aliases(df2),
        x=column_alias("system"),
        y=column_alias("time_per_syscall"),
        order=systems_order(df2),
        kind="bar",
        height=2.5,
        # aspect=1.2,
        color=color,
        palette=None,
    )
    # change_width(g.ax, 0.405)
    # g.ax.set_xlabel("")
    # g.ax.set_ylabel(g.ax.get_ylabel(), fontsize=8)

    # g.ax.set_xticklabels(g.ax.get_xmajorticklabels(), fontsize=8)
    # g.ax.set_yticklabels(g.ax.get_ymajorticklabels(), fontsize=8)
    # g.ax.grid(which="major")
    apply_to_graphs(g.ax, False, -1, 0.28)

    return g
コード例 #5
0
def sqlite_graph(df: pd.DataFrame) -> Any:
    plot_df = df
    df = df[df.columns[2]]
    df = df.map(apply_sqlite_rows)
    plot_df.update(df)

    plot_df["sqlite-op-type"] = plot_df["sqlite-op-type"].map({
        "5000 INSERTs into table with no index":
        "Insert",
        "5000 UPDATES of individual rows":
        "Update",
        "5000 DELETEs of individual rows":
        "Delete",
    })

    groups = len(set((list(plot_df["system"].values))))
    plot_df = apply_aliases(plot_df)

    g = catplot(
        data=plot_df,
        x=plot_df.columns[0],
        y=plot_df.columns[2],
        kind="bar",
        height=2.5,
        # aspect=0.8,
        order=systems_order(plot_df),
        hue="Operation",
        legend=False,
        palette=["darkgrey", "gray", "black"],
    )

    apply_to_graphs(g.ax, True, 3, 0.285)
    g.ax.legend(frameon=False)

    return g
コード例 #6
0
def smp_plot(dir: str, graphs: List[Any]) -> None:
    df = pd.read_csv(os.path.join(os.path.realpath(dir), "smp-latest.tsv"),
                     sep="\t")
    df = pd.melt(df,
                 id_vars=['cores', 'job'],
                 value_vars=['read-bw', 'write-bw'],
                 var_name="operation",
                 value_name="disk-throughput")
    df = df.groupby(["cores", "operation"]).sum().reset_index()

    df["disk-throughput"] /= 1024
    g = catplot(
        data=apply_aliases(df),
        x=column_alias("cores"),
        y=column_alias("disk-throughput"),
        hue=column_alias("operation"),
        kind="bar",
        height=2.5,
        legend=False,
        palette=["grey", "black"],
    )

    # change_width(g.ax, 0.25)
    # # g.ax.set_xlabel('')
    # g.ax.set_xticklabels(g.ax.get_xmajorticklabels(), fontsize=6)
    # g.ax.set_yticklabels(g.ax.get_ymajorticklabels(), fontsize=6)
    # g.ax.legend(loc='best', fontsize='small')
    apply_to_graphs(g.ax, True, 2, 0.285)

    graphs.append(g)
コード例 #7
0
def fio_read_write_graph(df: pd.DataFrame) -> Any:
    df = pd.melt(
        df,
        id_vars=["system", "job"],
        value_vars=["read-bw", "write-bw"],
        var_name="operation",
        value_name="disk-throughput",
    )
    df = df.groupby(["system", "operation"]).sum().reset_index()

    df["disk-throughput"] /= 1024
    g = catplot(
        data=apply_aliases(df),
        x=column_alias("system"),
        y=column_alias("disk-throughput"),
        hue=column_alias("operation"),
        order=systems_order(df),
        kind="bar",
        height=2.5,
        palette=palette,
        legend=False,
        # aspect=1.2,
    )
    # change_width(g.ax, 0.405)

    # g.ax.set_xlabel("")
    # g.ax.legend(loc="center", bbox_to_anchor=(0.5, 1.05), ncol=2, frameon=False)
    apply_to_graphs(g.ax, True, 2, 0.285)
    # g.ax.grid(which="major")
    return g
コード例 #8
0
def hdparm_graph(df: pd.DataFrame, metric: str) -> Any:
    plot_col = ["system"]

    if metric == "cached":
        plot_col.append("Timing buffer-cache reads")
        df["Timing buffer-cache reads"] = preprocess_hdparm(
            df["Timing buffer-cache reads"],
        )
    elif metric == "buffered":
        plot_col.append("Timing buffered disk reads")
        df["Timing buffered disk reads"] = preprocess_hdparm(
            df["Timing buffered disk reads"],
        )

    plot_df = df[plot_col]
    plot_df = apply_aliases(plot_df)

    g = catplot(
        data=plot_df,
        x=plot_df.columns[0],
        y=plot_df.columns[1],
        kind="bar",
        height=2.5,
        # aspect=1.2,
        color=color,
        palette=None,
    )
    apply_to_graphs(g.ax, False, -1)

    return g
コード例 #9
0
def network_bs_plot(dir: str, graphs: List[Any]) -> None:
    df = pd.read_csv(os.path.join(os.path.realpath(dir),
                                  "network-test-bs-latest.tsv"),
                     sep="\t")
    df["network-bs-throughput"] = 1024 / df["time"]
    # df["batch_size"] = df["batch_size"].apply(lambda x: str(x)+"KiB")

    g = catplot(
        data=apply_aliases(df),
        x=column_alias("batch_size"),
        y=column_alias("network-bs-throughput"),
        kind="bar",
        height=2.5,
        legend=False,
        color="black",
        palette=None,
    )

    # change_width(g.ax, 0.25)
    # # g.ax.set_xlabel('')
    # g.ax.set_xticklabels(g.ax.get_xmajorticklabels(), fontsize=6)
    # g.ax.set_yticklabels(g.ax.get_ymajorticklabels(), fontsize=6)
    apply_to_graphs(g.ax, False, -1)

    graphs.append(g)
コード例 #10
0
def hdparm_zerocopy_plot(dir: str, graphs: List[Any]) -> None:
    df_all_on = pd.read_csv(os.path.join(os.path.realpath(dir),
                                         "hdparm-all-on-latest.tsv"),
                            sep="\t")

    df_zcopy_off = pd.read_csv(os.path.join(os.path.realpath(dir),
                                            "hdparm-zerocopy-off-latest.tsv"),
                               sep="\t")

    df_all_on = df_all_on.drop(columns=["system"])
    df_zcopy_off = df_zcopy_off.drop(columns=["system"])

    df_all_on["Timing buffered disk reads"] = preprocess_hdparm(
        df_all_on["Timing buffered disk reads"], )
    df_zcopy_off["Timing buffered disk reads"] = preprocess_hdparm(
        df_zcopy_off["Timing buffered disk reads"], )

    df_all_on["Timing buffer-cache reads"] = preprocess_hdparm(
        df_all_on["Timing buffer-cache reads"], )

    df_zcopy_off["Timing buffer-cache reads"] = preprocess_hdparm(
        df_zcopy_off["Timing buffer-cache reads"], )

    df_all_on = df_all_on.T.reset_index()
    df_zcopy_off = df_zcopy_off.T.reset_index()

    df_zcopy_off.columns = ["hdparm_kind", "hdparm-throughput"]
    df_all_on.columns = ["hdparm_kind", "hdparm-throughput"]

    df_all_on["feature_spdk"] = pd.Series(["spdk-zerocopy"] *
                                          len(df_all_on.index),
                                          index=df_all_on.index)
    df_zcopy_off["feature_spdk"] = pd.Series(["spdk-copy"] *
                                             len(df_zcopy_off.index),
                                             index=df_zcopy_off.index)

    plot_df = pd.concat([df_all_on, df_zcopy_off], axis=0)
    groups = len(set(list(plot_df["feature_spdk"].values)))

    g = catplot(
        data=apply_aliases(plot_df),
        x=column_alias("feature_spdk"),
        y=column_alias("hdparm-throughput"),
        kind="bar",
        height=2.5,
        legend=False,
        hue=column_alias("hdparm_kind"),
        palette=["grey", "black"],
    )

    # apply_hatch(groups, g, True)
    # change_width(g.ax, 0.25)
    # g.ax.set_xlabel("")

    # g.ax.set_xticklabels(g.ax.get_xmajorticklabels(), fontsize=6)
    # g.ax.set_yticklabels(g.ax.get_ymajorticklabels(), fontsize=6)
    apply_to_graphs(g.ax, True, 2)

    graphs.append(g)
コード例 #11
0
def memcpy_graph(df: pd.DataFrame) -> Any:
    g = catplot(
        data=apply_aliases(df),
        x=column_alias("memcpy-size"),
        y=column_alias("memcpy-time"),
        hue=column_alias("memcpy-kind"),
        kind="bar",
        height=2.5,
        aspect=1.2,
    )

    return g
コード例 #12
0
def mysql_latency_graph(df: pd.DataFrame) -> Any:
    groups = len(set((list(df["system"].values))))

    g = catplot(
        data=apply_aliases(df),
        x=column_alias("system"),
        y=column_alias("Latency (ms) avg"),
        kind="bar",
        height=2.5,
        # aspect=1.2,
        color=color,
        palette=None,
        order=systems_order(df),
    )
    apply_to_graphs(g.ax, False, -1, 0.285)
    return g
コード例 #13
0
def spdk_zerocopy_plot(dir: str, graphs: List[Any]) -> None:
    df = pd.read_csv(os.path.join(os.path.realpath(dir),
                                  "spdk-zerocopy-latest.tsv"),
                     sep="\t")
    df = df.assign(aesnithroughput=df.bytes / df.time / 1024 / 1024)
    g = catplot(
        data=apply_aliases(df),
        x=column_alias("type"),
        y=column_alias("aesnithroughput"),
        kind="bar",
        height=2.5,
        aspect=1.2,
    )
    change_width(g.ax, 0.25)
    g.ax.set_xlabel('')
    graphs.append(g)
コード例 #14
0
def aesni_plot(dir: str, graphs: List[Any]) -> None:
    df = pd.read_csv(os.path.join(os.path.realpath(dir), "aesni-latest.tsv"),
                     sep="\t")
    df = df.assign(aesnithroughput=df.bytes / df.time / 1024 / 1024)
    g = catplot(data=apply_aliases(df),
                x=column_alias("type"),
                y=column_alias("aesnithroughput"),
                kind="bar",
                height=2.5,
                aspect=1.2,
                color="black",
                palette=None)
    apply_to_graphs(g.ax, False, -1, 0.1)
    g.ax.set_ylabel(g.ax.get_ylabel(), size=8)
    g.ax.set_xticklabels(g.ax.get_xticklabels(), size=8)
    g.ax.set_yticklabels(g.ax.get_yticklabels(), size=8)
    graphs.append(g)
コード例 #15
0
def iperf_graph(df: pd.DataFrame) -> Any:
    df = df[df["direction"] == "send"]
    df["iperf-throughput"] = df["bytes"] / df["seconds"] * 8 / 1e9

    g = catplot(
        data=apply_aliases(df),
        x=column_alias("system"),
        order=systems_order(df),
        y=column_alias("iperf-throughput"),
        kind="bar",
        height=2.5,
        # aspect=1.2,
        color=color,
        palette=None,
    )
    # change_width(g.ax, 0.405)
    # g.ax.set_xlabel("")

    apply_to_graphs(g.ax, False, -1, 0.285)

    # g.ax.grid(which="major")

    return g
コード例 #16
0
def storage_bs_plot(dir: str, graphs: List[Any]) -> None:
    df = pd.read_csv(os.path.join(os.path.realpath(dir), "simpleio-unenc.tsv"),
                     sep="\t")
    df["storage-bs-throughput"] = (10 * 1024) / df["time"]

    g = catplot(
        data=apply_aliases(df),
        x=column_alias("batch-size"),
        y=column_alias("storage-bs-throughput"),
        kind="bar",
        height=2.5,
        legend=False,
        color="black",
        palette=None,
    )

    # change_width(g.ax, 0.25)
    # # g.ax.set_xlabel('')
    # g.ax.set_xticklabels(g.ax.get_xmajorticklabels(), fontsize=6)
    # g.ax.set_yticklabels(g.ax.get_ymajorticklabels(), fontsize=6)

    apply_to_graphs(g.ax, False, -1)

    graphs.append(g)
コード例 #17
0
def redis_graph(df: pd.DataFrame, metric: str) -> Any:
    df_flag = None
    hue = None
    col_name = None
    legend = False
    color = None
    palette = None
    n_cols = None
    thru_ylabel = None
    width = None

    if metric == "thru":
        df_flag = df["metric"] == "Throughput(ops/sec)"
        col_name = "Throughput(ops/sec)"
        width = 0.285
        legend = False
    elif metric == "lat":
        df_flag = (df["metric"]
                   == "AverageLatency(us)") & (df["operation"] != "[CLEANUP]")
        col_name = "AverageLatency(us)"
        hue = "operation"
        legend = True
        width = 0.285

    plot_df = df[df_flag]
    groups = len(set((list(plot_df["system"].values))))
    plot_df = plot_df.drop(["metric"], axis=1)
    plot_df = plot_df.rename(columns={"value": col_name})
    plot_df = apply_aliases(plot_df)

    if hue is None:
        color = "black"
        palette = None
    else:
        palette = ["grey", "black"]
        n_cols = 2

    g = catplot(
        data=plot_df,
        x=plot_df.columns[0],
        y=plot_df.columns[-1],
        hue=hue,
        kind="bar",
        height=2.5,
        order=systems_order(plot_df),
        # aspect=1.2,
        legend=False,
        palette=palette,
        color=color,
    )

    apply_to_graphs(g.ax, legend, n_cols, width)
    g.ax.legend(ncol=2,
                loc="upper center",
                bbox_to_anchor=(0.5, 1.05),
                frameon=False)

    if metric == "thru":
        thru_ylabel = g.ax.get_yticklabels()
        thru_ylabel = [
            str(float(float(x.get_text()) / 1000)) + "k" for x in thru_ylabel
        ]
        thru_ylabel[0] = "0"
        thru_ylabel = [x.replace(".0k", "k") for x in thru_ylabel]
        g.ax.set_yticklabels(thru_ylabel)

    return g