analysis notebook sketch

This commit is contained in:
gmega 2024-12-10 19:45:41 -03:00
parent 278007cdce
commit 2c17527954
No known key found for this signature in database
GPG Key ID: 6290D34EAD824B18
2 changed files with 87 additions and 0 deletions

5
analysis/collect-logs.sh Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -e
kubectl logs --prefix -n codex-benchmarks -l app=deluge-nodes --tail=-1 > "${1}.log"
grep '\[M' "${1}.log" | tr -s ' ' | cut -d ' ' -f1,7 | sed 's/ /,/' | grep -v 'metric' > "${1}.csv"

View File

@ -0,0 +1,82 @@
---
title: "Static Network Experiment"
output: html_notebook
---
```{r}
library(tidyverse)
```
```{r}
deluge <- read_csv(
'./10-nodes-10-reps-4-seeders-2-seeder-sets-100MB.csv',
col_names = c('node', 'metric', 'timestamp', 'dataset', 'piece'),
show_col_types = FALSE
) |>
mutate(
temp = str_remove(dataset, "<unknown>,dataset-"),
seed_set = as.numeric(str_extract(temp, "^\\d+")),
run = as.numeric(str_extract(temp, "\\d+$"))
) |>
select(-temp)
```
```{r}
deluge <- deluge |>
group_by(node, seed_set, run) |>
arrange(timestamp) |>
mutate(
piece_index = seq_along(timestamp)
) |>
ungroup() |>
mutate(completed = piece_index / max(piece))
```
```{r}
# Adds elapsed time
deluge <- deluge |>
group_by(dataset) |>
mutate(
start_time = min(timestamp),
end_time = max(timestamp)
) |>
ungroup() |>
mutate(elapsed = timestamp - start_time)
```
```{r}
deluge |> head()
```
```{r}
deluge |>
group_by(node, seed_set, run) |>
count() |>
ungroup() |>
filter(n != 400)
```
```{r fig.width=10}
ggplot(deluge |> ungroup()) +
geom_line(aes(x=elapsed, y=completed, col=node), lwd=1) +
theme_minimal() +
facet_wrap(. ~ dataset, nrow = 4)
```
Averages the time to the $n^{th}$ piece index, over all runs for a given seed set:
```{r}
deluge_averaged <- deluge |>
group_by(node, seed_set, piece_index) |>
summarise(elapsed=mean(elapsed), .groups = 'drop')
```
```{r fig.width=10, fig.height=5}
ggplot(deluge_averaged) +
geom_line(aes(x = elapsed, y = piece_index, col = node), lwd=1) +
facet_wrap(. ~ seed_set) +
theme_minimal()
```