feat(graphs): new graph for bandwidth sweep
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env Rscript
|
||||
source("common.R")
|
||||
|
||||
BW_LEVELS <- c("1", "2", "4", "8")
|
||||
|
||||
parser <- fig_parser(description = "Per-flow IDT CDF across aggregate bandwidths (TSO Pacing)")
|
||||
parser$add_argument("--sample", type = "integer", default = 20000,
|
||||
help = "downsample to N points per bandwidth (0 = none)")
|
||||
parser$add_argument("--seed", type = "integer", default = 1)
|
||||
args <- parser$parse_args()
|
||||
|
||||
set.seed(args$seed)
|
||||
idts <- read_csv(file.path(args$data, "idts.csv"), show_col_types = FALSE) %>%
|
||||
mutate(bw = factor(as.character(solution), levels = BW_LEVELS))
|
||||
if (args$sample > 0) {
|
||||
idts <- idts %>% group_by(bw) %>% slice_sample(n = args$sample) %>% ungroup()
|
||||
}
|
||||
|
||||
p <- ggplot(idts, aes(x = idt_us, colour = bw))
|
||||
p <- p + stat_ecdf(linewidth = 0.9, pad = FALSE, key_glyph = "rect")
|
||||
p <- p + scale_x_log10(labels = label_comma())
|
||||
p <- p + scale_y_continuous(labels = label_pct())
|
||||
p <- p + scale_colour_viridis_d(end = 0.9, name = "Aggregate (Gbps)")
|
||||
p <- p + labs(x = paste0("Inter-departure time within flow (", label_us(), ")"), y = "CDF")
|
||||
p <- p + theme_paper()
|
||||
p <- p + theme(legend.text = element_text(size = rel(0.8)), legend.key.size = unit(6, "pt"))
|
||||
|
||||
if (args$zoom) {
|
||||
p <- p + coord_cartesian(xlim = c(3, 1000), ylim = c(0.9, 1.0))
|
||||
}
|
||||
|
||||
save_figure(p, args)
|
||||
Reference in New Issue
Block a user