Skip to content

Commit

Permalink
add comments to report.qmd
Browse files Browse the repository at this point in the history
  • Loading branch information
assignUser committed May 24, 2024
1 parent 04c010f commit 0b69693
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions scripts/bm-report/report.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,21 @@ library(plotly)
library(dplyr)
library(purrr)
# Cache conbench and gh api results for local development
cd <- cachem::cache_disk(rappdirs::user_cache_dir("velox-bm-report"))
mgh <- memoise::memoise(gh::gh, cache = cd)
mruns <- memoise::memoise(conbenchcoms::runs, cache = cd)
mresults <- memoise::memoise(conbenchcoms::benchmark_results, cache = cd)
# Get latest runs of build-metric job
runs <- mgh(
"GET /repos/facebookincubator/velox/actions/workflows/build-metrics.yml/runs",
status = "success",
branch = "main"
) |> jsonlite::toJSON()
# Extract the commit sha of the most recent run. The results of the latest
# run are displayed in the tables.
newest_sha <- runs |>
jqr::jq(".workflow_runs | max_by(.updated_at) | .head_sha") |>
jsonlite::fromJSON()
Expand All @@ -49,6 +53,8 @@ run_shas <- runs |>
run_ids <- mruns(run_shas) |>
filter(commit.branch == "facebookincubator:main", substr(id, 1, 2) == "BM") |>
pull(id)
# Fetch the result and do clean/format the data
results <- run_ids |>
purrr::map_df(mresults) |>
mutate(
Expand Down Expand Up @@ -79,6 +85,7 @@ format_tags <- function(x) {

## Times
```{r total-graphs}
# Filter the data and layout the overview plots
times_plot <- results |>
filter(tags.suite == "total", endsWith(tags.source, "time")) |>
mutate(
Expand Down Expand Up @@ -106,6 +113,7 @@ ggplotly(times_plot) |>
```

```{r expensive-objects-compile}
# Format compile time data
compile_times <- results |>
filter(tags.suite == "compiling", commit.sha == newest_sha) |>
mutate(
Expand All @@ -121,6 +129,7 @@ compile_times <- results |>
::: {.column width="49%"}

```{r compile-times-release}
# Select and format the data to be displayed in the release compile time table
compile_times |>
filter(type == "release") |>
select(tags.name, stats.data) |>
Expand All @@ -145,6 +154,7 @@ compile_times |>
::: {.column width="49%"}

```{r compile-times-debug}
# Select and format the data to be displayed in the debug compile time table
compile_times |>
filter(type == "debug") |>
select(tags.name, stats.data) |>
Expand All @@ -165,6 +175,7 @@ compile_times |>
::::

```{r expensive-objects-link}
# Format linke time data
link_times <- results |>
filter(tags.suite == "linking", commit.sha == newest_sha) |>
mutate(
Expand All @@ -181,6 +192,7 @@ link_times <- results |>
::: {.column width="49%"}

```{r link-times-release}
# Select and format the data to be displayed in the release link time table
link_times |>
filter(type == "release") |>
select(tags.name, stats.data) |>
Expand All @@ -205,6 +217,7 @@ link_times |>
::: {.column width="49%"}

```{r link-times-debug}
# Select and format the data to be displayed in the debug link time table
link_times |>
filter(type == "debug") |>
select(tags.name, stats.data) |>
Expand All @@ -227,17 +240,21 @@ link_times |>

## Sizes
```{r big-objects}
# This is converts byte values into human-readable values in the tables
size_formatter <- function(x) {
function(x) {
prettyunits::pretty_bytes(x)
}
}
# Prepare object size data
object_sizes <- results |>
filter(endsWith(tags.source, "size"), commit.sha == newest_sha) |>
mutate(
tags.name = glue::glue("`{tags.name}`")
)
# Filter the data and layout the size overview plots
sizes_plot <- results |>
filter(tags.suite == "executable", startsWith(tags.name, "total_")) |>
ggplot(aes(
Expand Down Expand Up @@ -266,6 +283,7 @@ ggplotly(sizes_plot) |>
::: {.column width="49%"}

```{r object-sizes-release}
# Select and format the data to be displayed in the release size table
object_sizes |>
filter(type == "release") |>
select(tags.name, stats.data) |>
Expand All @@ -291,6 +309,7 @@ object_sizes |>
::: {.column width="49%"}

```{r object-sizes-debug}
# Select and format the data to be displayed in the debug size table
object_sizes |>
filter(type == "debug") |>
select(tags.name, stats.data) |>
Expand Down

0 comments on commit 0b69693

Please sign in to comment.