initial commit for public eval
This commit is contained in:
@@ -0,0 +1 @@
|
||||
source("renv/activate.R")
|
||||
@@ -0,0 +1,11 @@
|
||||
out/
|
||||
renv/library/
|
||||
renv/local/
|
||||
renv/cellar/
|
||||
renv/lock/
|
||||
renv/sandbox/
|
||||
renv/staging/
|
||||
.Rproj.user/
|
||||
.Rhistory
|
||||
.RData
|
||||
.Ruserdata
|
||||
@@ -0,0 +1,170 @@
|
||||
-include ../local.mk
|
||||
|
||||
EXP ?= datacenter-fq
|
||||
SETUP ?= datacenter_fq
|
||||
SOLUTIONS ?= no-tso tso tso-pacing
|
||||
FIG_STEMS ?= throughput throughput_zoom rtt rtt_zoom sender_cpu receiver_cpu timeseries idt_cdf idt_cdf_zoom
|
||||
|
||||
# Global figure size and font size (inches, pt). Inherited by every Rscript
|
||||
# via the export below; common.R reads these as Sys.getenv("FIG_*").
|
||||
# Override on the command line: make FIG_WIDTH=2.5 FIG_HEIGHT=1.8 FIG_FONTSIZE=8 datacenter-fq
|
||||
FIG_WIDTH ?= 2.5
|
||||
FIG_HEIGHT ?= 2.0
|
||||
FIG_FONTSIZE ?= 9
|
||||
export FIG_WIDTH FIG_HEIGHT FIG_FONTSIZE
|
||||
|
||||
THROUGHPUT_SIZE_ARGS ?=
|
||||
RTT_SIZE_ARGS ?=
|
||||
THROUGHPUT_ARGS ?=
|
||||
RTT_ARGS ?=
|
||||
THROUGHPUT_ZOOM_ARGS ?= --ymin 3.5 --ymax 4.0 --ystep 0.1
|
||||
RTT_ZOOM_ARGS ?= --ymin 4 --ymax 14 --ystep 2
|
||||
SENDER_CPU_ARGS ?=
|
||||
RECEIVER_CPU_ARGS ?=
|
||||
TIMESERIES_ARGS ?=
|
||||
IDT_CDF_ARGS ?=
|
||||
|
||||
ROOT := ..
|
||||
RAW_DATA_ROOT ?= $(ROOT)/../raw_data
|
||||
RAW := $(RAW_DATA_ROOT)/$(EXP)/aggregates
|
||||
DERIVED := $(ROOT)/derived/$(EXP)
|
||||
DERIVED_ROOT := $(ROOT)/derived
|
||||
OUT := ../out/$(EXP)
|
||||
VALUES_TEX := ../out/values.tex
|
||||
VALUES_PLUGINS := $(wildcard $(ROOT)/analysis/values/*.py)
|
||||
SKIP_PLUGINS ?=
|
||||
|
||||
CSVS := $(addprefix $(DERIVED)/, runs.csv rtts.csv idts.csv firstflow_bins.csv)
|
||||
PDFS := $(addprefix $(OUT)/, $(addsuffix .pdf, $(FIG_STEMS)))
|
||||
TEXS := $(addprefix $(OUT)/, $(addsuffix .tex, $(FIG_STEMS)))
|
||||
|
||||
.PHONY: all derive figures tikz sanity values pdfs tex clean datacenter-fq datacenter-fq-tikz direct-link direct-link-tikz all-experiments all-experiments-tikz
|
||||
.DELETE_ON_ERROR:
|
||||
|
||||
all: all-experiments
|
||||
|
||||
derive: $(DERIVED)/.stamp
|
||||
|
||||
$(DERIVED)/.stamp: $(ROOT)/analysis/aggregate.py
|
||||
cd $(ROOT)/analysis && uv run python aggregate.py --raw $(abspath $(RAW)) --setup-prefix $(SETUP) --solutions $(SOLUTIONS) --out $(abspath $(DERIVED))
|
||||
touch $@
|
||||
|
||||
$(CSVS): $(DERIVED)/.stamp
|
||||
|
||||
sanity: $(DERIVED)/.stamp
|
||||
cd $(ROOT)/analysis && uv run python sanity_check.py --derived $(abspath $(DERIVED)) --solutions $(SOLUTIONS)
|
||||
|
||||
figures: all-experiments
|
||||
tikz: all-experiments-tikz
|
||||
|
||||
pdfs: $(PDFS)
|
||||
tex: $(TEXS)
|
||||
|
||||
FMT_FLAG = $(if $(filter %.tex,$@),--tikz,--pdf)
|
||||
|
||||
$(OUT)/throughput.pdf $(OUT)/throughput.tex: fig_throughput.R common.R $(CSVS) Makefile
|
||||
@mkdir -p $(OUT)
|
||||
Rscript $< --data $(DERIVED) $(FMT_FLAG) $@ $(THROUGHPUT_SIZE_ARGS) $(THROUGHPUT_ARGS)
|
||||
|
||||
$(OUT)/throughput_zoom.pdf $(OUT)/throughput_zoom.tex: fig_throughput.R common.R $(CSVS) Makefile
|
||||
@mkdir -p $(OUT)
|
||||
Rscript $< --data $(DERIVED) $(FMT_FLAG) $@ --zoom $(THROUGHPUT_SIZE_ARGS) $(THROUGHPUT_ZOOM_ARGS)
|
||||
|
||||
$(OUT)/rtt.pdf $(OUT)/rtt.tex: fig_rtt.R common.R $(CSVS) Makefile
|
||||
@mkdir -p $(OUT)
|
||||
Rscript $< --data $(DERIVED) $(FMT_FLAG) $@ $(RTT_SIZE_ARGS) $(RTT_ARGS)
|
||||
|
||||
$(OUT)/rtt_zoom.pdf $(OUT)/rtt_zoom.tex: fig_rtt.R common.R $(CSVS) Makefile
|
||||
@mkdir -p $(OUT)
|
||||
Rscript $< --data $(DERIVED) $(FMT_FLAG) $@ --zoom $(RTT_SIZE_ARGS) $(RTT_ZOOM_ARGS)
|
||||
|
||||
$(OUT)/sender_cpu.pdf $(OUT)/sender_cpu.tex: fig_sender_cpu.R common.R $(CSVS) Makefile
|
||||
@mkdir -p $(OUT)
|
||||
Rscript $< --data $(DERIVED) $(FMT_FLAG) $@ $(SENDER_CPU_ARGS)
|
||||
|
||||
$(OUT)/receiver_cpu.pdf $(OUT)/receiver_cpu.tex: fig_receiver_cpu.R common.R $(CSVS) Makefile
|
||||
@mkdir -p $(OUT)
|
||||
Rscript $< --data $(DERIVED) $(FMT_FLAG) $@ $(RECEIVER_CPU_ARGS)
|
||||
|
||||
$(OUT)/timeseries.pdf $(OUT)/timeseries.tex: fig_timeseries.R common.R $(CSVS) Makefile
|
||||
@mkdir -p $(OUT)
|
||||
Rscript $< --data $(DERIVED) $(FMT_FLAG) $@ $(TIMESERIES_ARGS)
|
||||
|
||||
$(OUT)/idt_cdf.pdf $(OUT)/idt_cdf.tex: fig_idt_cdf.R common.R $(CSVS) Makefile
|
||||
@mkdir -p $(OUT)
|
||||
Rscript $< --data $(DERIVED) $(FMT_FLAG) $@ $(IDT_CDF_ARGS)
|
||||
|
||||
$(OUT)/idt_cdf_zoom.pdf $(OUT)/idt_cdf_zoom.tex: fig_idt_cdf.R common.R $(CSVS) Makefile
|
||||
@mkdir -p $(OUT)
|
||||
Rscript $< --data $(DERIVED) $(FMT_FLAG) $@ --zoom $(IDT_CDF_ARGS)
|
||||
|
||||
$(OUT)/%.pdf: fig_%.R common.R $(CSVS) Makefile
|
||||
@mkdir -p $(OUT)
|
||||
Rscript $< --data $(DERIVED) --pdf $@
|
||||
|
||||
$(OUT)/%_zoom.pdf: fig_%.R common.R $(CSVS) Makefile
|
||||
@mkdir -p $(OUT)
|
||||
Rscript $< --data $(DERIVED) --pdf $@ --zoom
|
||||
|
||||
$(OUT)/%.tex: fig_%.R common.R $(CSVS) Makefile
|
||||
@mkdir -p $(OUT)
|
||||
Rscript $< --data $(DERIVED) --tikz $@
|
||||
|
||||
$(OUT)/%_zoom.tex: fig_%.R common.R $(CSVS) Makefile
|
||||
@mkdir -p $(OUT)
|
||||
Rscript $< --data $(DERIVED) --tikz $@ --zoom
|
||||
|
||||
values: $(VALUES_TEX)
|
||||
|
||||
# SKIP_PLUGINS is a runtime decision, not a file dependency: force rebuild
|
||||
# whenever the user sets it on the command line.
|
||||
ifneq ($(SKIP_PLUGINS),)
|
||||
.PHONY: $(VALUES_TEX)
|
||||
endif
|
||||
|
||||
$(VALUES_TEX): $(ROOT)/analysis/gen_values.py $(VALUES_PLUGINS) $(DERIVED_ROOT)/datacenter-fq/.stamp $(DERIVED_ROOT)/direct-link/.stamp Makefile
|
||||
@mkdir -p $(dir $(VALUES_TEX))
|
||||
cd $(ROOT)/analysis && uv run python gen_values.py --derived $(abspath $(DERIVED_ROOT)) --out $(abspath $(VALUES_TEX)) $(if $(SKIP_PLUGINS),--skip $(SKIP_PLUGINS))
|
||||
|
||||
clean:
|
||||
rm -rf $(OUT) $(DERIVED)
|
||||
|
||||
# Per-experiment shortcut targets. Each recursively invokes the makefile
|
||||
# with the right EXP / SETUP / FIG_STEMS / zoom overrides.
|
||||
|
||||
# Per-experiment knobs. Each shortcut target reuses these via $(call ...).
|
||||
QUARTER_SIZE := --width 1.4 --height 1.5
|
||||
|
||||
DATACENTER_FQ_ARGS = EXP=datacenter-fq SETUP=datacenter_fq \
|
||||
SOLUTIONS="no-tso tso tso-pacing cake:datacenter_cake_no-tso" \
|
||||
FIG_STEMS="throughput throughput_zoom rtt rtt_zoom sender_cpu receiver_cpu timeseries idt_cdf idt_cdf_zoom" \
|
||||
THROUGHPUT_SIZE_ARGS="$(QUARTER_SIZE)" \
|
||||
RTT_SIZE_ARGS="$(QUARTER_SIZE)" \
|
||||
THROUGHPUT_ZOOM_ARGS="--ymin 3.5 --ymax 4.0 --ystep 0.1" \
|
||||
RTT_ZOOM_ARGS="--ymin 4 --ymax 14 --ystep 2"
|
||||
|
||||
DIRECT_LINK_ARGS = EXP=direct-link SETUP=direct-link_fq \
|
||||
SOLUTIONS="no-tso tso tso-pacing cake:direct-link_cake_no-tso" \
|
||||
FIG_STEMS="throughput throughput_zoom rtt rtt_zoom sender_cpu receiver_cpu" \
|
||||
THROUGHPUT_SIZE_ARGS="$(QUARTER_SIZE)" \
|
||||
RTT_SIZE_ARGS="$(QUARTER_SIZE)" \
|
||||
THROUGHPUT_ARGS="--ymax 10 --ystep 2" \
|
||||
THROUGHPUT_ZOOM_ARGS="--ymin 9.0 --ymax 10.0 --ystep 0.2" \
|
||||
RTT_ZOOM_ARGS="--ymin 1.75 --ymax 4 --ystep 1" \
|
||||
SENDER_CPU_ARGS="--ystep 1" \
|
||||
RECEIVER_CPU_ARGS="--ystep 5"
|
||||
|
||||
datacenter-fq:
|
||||
$(MAKE) pdfs $(DATACENTER_FQ_ARGS)
|
||||
|
||||
datacenter-fq-tikz:
|
||||
$(MAKE) tex $(DATACENTER_FQ_ARGS)
|
||||
|
||||
direct-link:
|
||||
$(MAKE) pdfs $(DIRECT_LINK_ARGS)
|
||||
|
||||
direct-link-tikz:
|
||||
$(MAKE) tex $(DIRECT_LINK_ARGS)
|
||||
|
||||
all-experiments: datacenter-fq direct-link
|
||||
all-experiments-tikz: datacenter-fq-tikz direct-link-tikz
|
||||
@@ -0,0 +1,128 @@
|
||||
suppressPackageStartupMessages({
|
||||
library(argparse)
|
||||
library(ggplot2)
|
||||
library(dplyr)
|
||||
library(tidyr)
|
||||
library(readr)
|
||||
library(scales)
|
||||
library(tikzDevice)
|
||||
})
|
||||
|
||||
SOLUTION_ORDER <- c("tso", "tso-pacing", "cake")
|
||||
|
||||
SOLUTION_LABELS <- c(
|
||||
"no-tso" = "TSO Off",
|
||||
"tso" = "TSO On",
|
||||
"tso-pacing" = "TSO Pacing",
|
||||
"cake" = "Cake"
|
||||
)
|
||||
|
||||
SOLUTION_COLORS <- c(
|
||||
"no-tso" = "#009E73",
|
||||
"tso" = "#E69F00",
|
||||
"tso-pacing" = "#0072B2",
|
||||
"cake" = "#CC79A7"
|
||||
)
|
||||
|
||||
SOLUTION_LINETYPES <- c(
|
||||
"no-tso" = "longdash",
|
||||
"tso" = "dashed",
|
||||
"tso-pacing" = "solid",
|
||||
"cake" = "twodash"
|
||||
)
|
||||
|
||||
# Global figure size and font size, overridable via env vars
|
||||
# (Makefile exports FIG_WIDTH / FIG_HEIGHT / FIG_FONTSIZE).
|
||||
.env_num <- function(var, default) {
|
||||
v <- Sys.getenv(var)
|
||||
if (nchar(v) == 0) default else as.numeric(v)
|
||||
}
|
||||
DEFAULT_WIDTH <- .env_num("FIG_WIDTH", 3.33)
|
||||
DEFAULT_HEIGHT <- .env_num("FIG_HEIGHT", 2.4)
|
||||
DEFAULT_FONTSIZE <- .env_num("FIG_FONTSIZE", 10)
|
||||
|
||||
theme_paper <- function(base_size = DEFAULT_FONTSIZE) {
|
||||
theme_bw(base_size = base_size) +
|
||||
theme(
|
||||
legend.position = "bottom",
|
||||
legend.title = element_blank(),
|
||||
legend.margin = margin(t = -4, l = -20),
|
||||
legend.text = element_text(size = base_size - 1),
|
||||
legend.key.size = unit(base_size, "pt"),
|
||||
axis.text = element_text(size = base_size - 1),
|
||||
strip.background = element_rect(fill = "grey90"),
|
||||
panel.grid.minor = element_blank(),
|
||||
plot.margin = margin(2, 4, 2, 2)
|
||||
)
|
||||
}
|
||||
|
||||
prepare_solution <- function(df) {
|
||||
df %>%
|
||||
filter(solution %in% SOLUTION_ORDER) %>%
|
||||
mutate(solution = factor(solution, levels = SOLUTION_ORDER,
|
||||
labels = SOLUTION_LABELS[SOLUTION_ORDER]))
|
||||
}
|
||||
|
||||
LABEL_COLORS <- setNames(SOLUTION_COLORS[SOLUTION_ORDER], SOLUTION_LABELS[SOLUTION_ORDER])
|
||||
LABEL_LINETYPES <- setNames(SOLUTION_LINETYPES[SOLUTION_ORDER], SOLUTION_LABELS[SOLUTION_ORDER])
|
||||
|
||||
COL_WIDTH <- 3.33
|
||||
TEXT_WIDTH <- 7.0
|
||||
|
||||
# ACM page-fraction presets, in inches.
|
||||
HALF_WIDTH <- 3.3 # two figures side-by-side under one \begin{figure}
|
||||
THIRD_WIDTH <- 2.2 # three figures side-by-side
|
||||
|
||||
label_pct <- function() percent_format(accuracy = 1)
|
||||
label_us <- function() "µs"
|
||||
pct_sign <- function() "%"
|
||||
|
||||
fig_parser <- function(default_width = DEFAULT_WIDTH, default_height = DEFAULT_HEIGHT,
|
||||
description = "Generate figure") {
|
||||
p <- ArgumentParser(description = description)
|
||||
p$add_argument("--data", required = TRUE, help = "derived CSV directory")
|
||||
p$add_argument("--pdf", help = "write PDF to this path")
|
||||
p$add_argument("--tikz", help = "write tikz .tex to this path")
|
||||
p$add_argument("--width", type = "double", default = default_width)
|
||||
p$add_argument("--height", type = "double", default = default_height)
|
||||
p$add_argument("--zoom", action = "store_true", help = "use zoomed axis limits")
|
||||
p$add_argument("--debug-margins", action = "store_true",
|
||||
help = "color plot.background / panel.background / panel.border to visualise layout")
|
||||
p
|
||||
}
|
||||
|
||||
# Optional theme overlay that colors the plot canvas, plot panel, and panel
|
||||
# border so layout / whitespace can be inspected. Returns NULL when off
|
||||
# (adding NULL to a ggplot is a no-op).
|
||||
theme_debug_margins <- function(args) {
|
||||
if (!isTRUE(args$debug_margins)) return(NULL)
|
||||
theme(
|
||||
plot.background = element_rect(fill = "#FFF7B3", colour = "black"),
|
||||
panel.background = element_rect(fill = "#CCE5FF", colour = NA),
|
||||
panel.border = element_rect(colour = "red", fill = NA, linewidth = 0.6)
|
||||
)
|
||||
}
|
||||
|
||||
save_figure <- function(plot, args) {
|
||||
if (is.null(args$pdf) && is.null(args$tikz)) {
|
||||
stop("save_figure: pass --pdf and/or --tikz")
|
||||
}
|
||||
if (!is.null(args$pdf)) {
|
||||
dir.create(dirname(args$pdf), showWarnings = FALSE, recursive = TRUE)
|
||||
ggsave(args$pdf, plot, width = args$width, height = args$height, device = "pdf")
|
||||
message("wrote ", args$pdf)
|
||||
}
|
||||
if (!is.null(args$tikz)) {
|
||||
dir.create(dirname(args$tikz), showWarnings = FALSE, recursive = TRUE)
|
||||
old <- options(
|
||||
tikzSanitizeCharacters = c(getOption("tikzSanitizeCharacters"), "µ"),
|
||||
tikzReplacementCharacters = c(getOption("tikzReplacementCharacters"), "$\\mu$")
|
||||
)
|
||||
on.exit(options(old), add = TRUE)
|
||||
tikz(args$tikz, width = args$width, height = args$height,
|
||||
standAlone = FALSE, sanitize = TRUE)
|
||||
print(plot)
|
||||
dev.off()
|
||||
message("wrote ", args$tikz)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env Rscript
|
||||
source("common.R")
|
||||
|
||||
# Random sample size per solution. stat_ecdf emits one tikz path segment per
|
||||
# unique x value; the raw idts.csv has ~120 K unique values per solution,
|
||||
# producing a ~500 K-line tikz file that exceeds pdflatex main_memory.
|
||||
# 5000 samples per solution preserve the CDF shape (including the 92.5-100 %
|
||||
# zoom tail: ~375 points) and keep the tikz file manageable.
|
||||
SAMPLE_PER_SOLUTION <- 20000
|
||||
|
||||
parser <- fig_parser(description = "Per-flow inter-departure-time CDF")
|
||||
parser$add_argument("--sample", type = "integer", default = SAMPLE_PER_SOLUTION,
|
||||
help = "downsample to N points per solution (0 = no downsampling)")
|
||||
parser$add_argument("--seed", type = "integer", default = 1,
|
||||
help = "RNG seed for downsampling")
|
||||
args <- parser$parse_args()
|
||||
|
||||
set.seed(args$seed)
|
||||
idts <- read_csv(file.path(args$data, "idts.csv"), show_col_types = FALSE) %>%
|
||||
prepare_solution()
|
||||
if (args$sample > 0) {
|
||||
idts <- idts %>%
|
||||
group_by(solution) %>%
|
||||
slice_sample(n = args$sample) %>%
|
||||
ungroup()
|
||||
}
|
||||
|
||||
p <- ggplot(idts, aes(x = idt_us, colour = solution, linetype = solution)) +
|
||||
stat_ecdf(linewidth = 0.9, pad = FALSE, key_glyph = "rect") +
|
||||
scale_x_log10(labels = label_comma()) +
|
||||
scale_y_continuous(labels = label_pct()) +
|
||||
scale_colour_manual(values = LABEL_COLORS) +
|
||||
scale_linetype_manual(values = LABEL_LINETYPES) +
|
||||
labs(x = paste0("Inter-departure time within flow (", label_us(), ")"), y = "CDF") +
|
||||
theme_paper() +
|
||||
theme(legend.text = element_text(size = rel(0.8)),
|
||||
legend.key.size = unit(6, "pt"))
|
||||
|
||||
if (args$zoom) {
|
||||
p <- p + coord_cartesian(xlim = c(10, 1000), ylim = c(0.925, 1.0))
|
||||
}
|
||||
|
||||
save_figure(p, args)
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env Rscript
|
||||
source("common.R")
|
||||
|
||||
parser <- fig_parser(description = "Receiver CPU bar chart")
|
||||
parser$add_argument("--ystep", type = "double",
|
||||
help = "y-axis major tick spacing (omit = auto)")
|
||||
args <- parser$parse_args()
|
||||
|
||||
runs <- read_csv(file.path(args$data, "runs.csv"), show_col_types = FALSE) %>%
|
||||
prepare_solution() %>%
|
||||
group_by(solution) %>%
|
||||
summarise(mean_pct = mean(cpu_receiver),
|
||||
sd_pct = sd(cpu_receiver), .groups = "drop")
|
||||
|
||||
p <- ggplot(runs, aes(x = solution, y = mean_pct, fill = solution)) +
|
||||
geom_col(width = 0.6, colour = "black") +
|
||||
geom_errorbar(aes(ymin = mean_pct - sd_pct, ymax = mean_pct + sd_pct),
|
||||
width = 0.2) +
|
||||
scale_fill_manual(values = LABEL_COLORS, guide = "none") +
|
||||
labs(x = NULL, y = paste0("Average CPU usage (", pct_sign(), ")")) +
|
||||
theme_paper()
|
||||
|
||||
if (!is.null(args$ystep)) {
|
||||
p <- p + scale_y_continuous(breaks = scales::breaks_width(args$ystep))
|
||||
}
|
||||
|
||||
save_figure(p, args)
|
||||
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env Rscript
|
||||
source("common.R")
|
||||
|
||||
parser <- fig_parser(description = "RTT box plot")
|
||||
parser$add_argument("--ymin", type = "double", default = 4)
|
||||
parser$add_argument("--ymax", type = "double", default = 14)
|
||||
parser$add_argument("--ystep", type = "double", default = 2)
|
||||
args <- parser$parse_args()
|
||||
|
||||
stats <- read_csv(file.path(args$data, "rtts.csv"), show_col_types = FALSE) %>%
|
||||
mutate(rtt_ms = rtt_us / 1000) %>%
|
||||
prepare_solution() %>%
|
||||
group_by(solution) %>%
|
||||
summarise(
|
||||
ymin = quantile(rtt_ms, 0.05),
|
||||
lower = quantile(rtt_ms, 0.25),
|
||||
middle = median(rtt_ms),
|
||||
upper = quantile(rtt_ms, 0.75),
|
||||
ymax = quantile(rtt_ms, 0.95),
|
||||
.groups = "drop"
|
||||
)
|
||||
|
||||
p <- ggplot(stats, aes(x = solution, fill = solution)) +
|
||||
geom_boxplot(aes(ymin = ymin, lower = lower, middle = middle,
|
||||
upper = upper, ymax = ymax),
|
||||
stat = "identity", width = 0.6, colour = "black") +
|
||||
scale_fill_manual(values = LABEL_COLORS, guide = "none") +
|
||||
labs(x = NULL, y = "RTT (ms)") +
|
||||
theme_paper() +
|
||||
theme(axis.text.x = element_text(angle = 45, hjust = 1),
|
||||
plot.margin = margin(2, 4, 0, 2)) +
|
||||
theme_debug_margins(args)
|
||||
|
||||
if (args$zoom) {
|
||||
p <- p + coord_cartesian(ylim = c(args$ymin, args$ymax)) +
|
||||
scale_y_continuous(breaks = seq(args$ymin, args$ymax, args$ystep))
|
||||
} else {
|
||||
p <- p + coord_cartesian(ylim = c(0, NA))
|
||||
}
|
||||
|
||||
save_figure(p, args)
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env Rscript
|
||||
source("common.R")
|
||||
|
||||
parser <- fig_parser(description = "Sender CPU bar chart")
|
||||
parser$add_argument("--ystep", type = "double",
|
||||
help = "y-axis major tick spacing (omit = auto)")
|
||||
args <- parser$parse_args()
|
||||
|
||||
runs <- read_csv(file.path(args$data, "runs.csv"), show_col_types = FALSE) %>%
|
||||
prepare_solution() %>%
|
||||
group_by(solution) %>%
|
||||
summarise(mean_pct = mean(cpu_sender),
|
||||
sd_pct = sd(cpu_sender), .groups = "drop")
|
||||
|
||||
p <- ggplot(runs, aes(x = solution, y = mean_pct, fill = solution)) +
|
||||
geom_col(width = 0.6, colour = "black") +
|
||||
geom_errorbar(aes(ymin = mean_pct - sd_pct, ymax = mean_pct + sd_pct),
|
||||
width = 0.2) +
|
||||
scale_fill_manual(values = LABEL_COLORS, guide = "none") +
|
||||
labs(x = NULL, y = paste0("Average CPU usage (", pct_sign(), ")")) +
|
||||
theme_paper()
|
||||
|
||||
if (!is.null(args$ystep)) {
|
||||
p <- p + scale_y_continuous(breaks = scales::breaks_width(args$ystep))
|
||||
}
|
||||
|
||||
save_figure(p, args)
|
||||
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env Rscript
|
||||
source("common.R")
|
||||
|
||||
parser <- fig_parser(description = "Throughput bar chart")
|
||||
parser$add_argument("--ymin", type = "double")
|
||||
parser$add_argument("--ymax", type = "double")
|
||||
parser$add_argument("--ystep", type = "double")
|
||||
args <- parser$parse_args()
|
||||
|
||||
runs <- read_csv(file.path(args$data, "runs.csv"), show_col_types = FALSE) %>%
|
||||
prepare_solution() %>%
|
||||
group_by(solution) %>%
|
||||
summarise(mean_gbps = mean(throughput_bps) / 1e9,
|
||||
sd_gbps = sd(throughput_bps) / 1e9, .groups = "drop")
|
||||
|
||||
p <- ggplot(runs, aes(x = solution, y = mean_gbps, fill = solution)) +
|
||||
geom_col(width = 0.6, colour = "black") +
|
||||
geom_errorbar(aes(ymin = mean_gbps - sd_gbps, ymax = mean_gbps + sd_gbps),
|
||||
width = 0.2) +
|
||||
scale_fill_manual(values = LABEL_COLORS, guide = "none") +
|
||||
labs(x = NULL, y = "Throughput (Gbps)") +
|
||||
theme_paper() +
|
||||
theme(axis.text.x = element_text(angle = 45, hjust = 1),
|
||||
plot.margin = margin(2, 4, 0, 2)) +
|
||||
theme_debug_margins(args)
|
||||
|
||||
if (!is.null(args$ymax)) {
|
||||
ymin <- if (is.null(args$ymin)) 0 else args$ymin
|
||||
p <- p + coord_cartesian(ylim = c(ymin, args$ymax))
|
||||
if (!is.null(args$ystep)) {
|
||||
p <- p + scale_y_continuous(breaks = seq(ymin, args$ymax, args$ystep))
|
||||
}
|
||||
}
|
||||
|
||||
save_figure(p, args)
|
||||
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env Rscript
|
||||
source("common.R")
|
||||
|
||||
parser <- fig_parser(description = "First-flow packet timeseries")
|
||||
parser$add_argument("--xmin", type = "double", default = 100.0)
|
||||
parser$add_argument("--xmax", type = "double", default = 105.0)
|
||||
args <- parser$parse_args()
|
||||
|
||||
bins <- read_csv(file.path(args$data, "firstflow_bins.csv"), show_col_types = FALSE) %>%
|
||||
group_by(solution) %>%
|
||||
mutate(t_ms = t_ms - min(t_ms)) %>%
|
||||
ungroup() %>%
|
||||
filter(t_ms >= args$xmin, t_ms <= args$xmax) %>%
|
||||
prepare_solution()
|
||||
|
||||
pacing_label <- SOLUTION_LABELS[["tso-pacing"]]
|
||||
back <- bins %>% filter(solution == pacing_label)
|
||||
front <- bins %>% filter(solution != pacing_label)
|
||||
|
||||
p <- ggplot() +
|
||||
geom_area(data = back, aes(x = t_ms, y = packets, fill = solution),
|
||||
alpha = 0.22, show.legend = FALSE) +
|
||||
geom_line(data = back, aes(x = t_ms, y = packets, colour = solution,
|
||||
linetype = solution), linewidth = 0.9, key_glyph = "rect") +
|
||||
geom_line(data = front, aes(x = t_ms, y = packets, colour = solution,
|
||||
linetype = solution), linewidth = 0.9, key_glyph = "rect") +
|
||||
scale_colour_manual(values = LABEL_COLORS, breaks = names(LABEL_COLORS)) +
|
||||
scale_fill_manual(values = LABEL_COLORS, breaks = names(LABEL_COLORS)) +
|
||||
scale_linetype_manual(values = LABEL_LINETYPES, breaks = names(LABEL_LINETYPES)) +
|
||||
scale_x_continuous(breaks = seq(args$xmin, args$xmax, 1)) +
|
||||
scale_y_continuous(breaks = seq(0, 45, 5), limits = c(0, 45)) +
|
||||
labs(x = "Time elapsed (ms)", y = paste0("Packets per 50 ", label_us(), " bin")) +
|
||||
theme_paper() +
|
||||
theme(legend.text = element_text(size = rel(0.8)),
|
||||
legend.key.size = unit(6, "pt"))
|
||||
|
||||
save_figure(p, args)
|
||||
+2296
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
library/
|
||||
local/
|
||||
cellar/
|
||||
lock/
|
||||
python/
|
||||
sandbox/
|
||||
staging/
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"bioconductor.version": null,
|
||||
"external.libraries": [],
|
||||
"ignored.packages": [],
|
||||
"lockfile.sanitize": true,
|
||||
"package.dependency.fields": [
|
||||
"Imports",
|
||||
"Depends",
|
||||
"LinkingTo"
|
||||
],
|
||||
"ppm.enabled": null,
|
||||
"ppm.ignored.urls": [],
|
||||
"r.version": null,
|
||||
"snapshot.dev": false,
|
||||
"snapshot.type": "implicit",
|
||||
"use.cache": true,
|
||||
"vcs.ignore.cellar": true,
|
||||
"vcs.ignore.library": true,
|
||||
"vcs.ignore.local": true,
|
||||
"vcs.manage.ignores": true
|
||||
}
|
||||
Reference in New Issue
Block a user