From 1f2df5f10f3ff5fa00e85ec6130ac67be4dc5e16 Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Mon, 29 Jan 2024 14:51:29 -0500 Subject: [PATCH 1/2] fix: remove 'avail' from total usage plot also fix minimum user GiB variable --- report.Rmd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/report.Rmd b/report.Rmd index 8f256c6..c6216c9 100644 --- a/report.Rmd +++ b/report.Rmd @@ -101,11 +101,11 @@ plot_metric_time <- function(dat, y_metric) { labs(y = y_metric) } -min_bytes_GiB <- 10 +min_user_bytes_GiB <- 10 panel_summary <- function(dat, folder_path = "/data/CCBR", plot_fcn = plot_metric_time, - min_bytes_GiB = min_bytes_GiB) { + min_bytes_GiB = min_user_bytes_GiB) { summary_dat_folder <- dat %>% filter(FolderPath == folder_path) %>% mutate(TotalBytes_GiB = from_bytes(TotalBytes, 'GiB')) %>% @@ -298,7 +298,7 @@ layout_column_wrap( p <- disk_usage %>% mutate(datetime = lubridate::as_datetime(datetime)) %>% rename(used = used_tib, size = size_tib, avail = avail_tib) %>% - pivot_longer(c(used, size, avail), names_to = 'metric') %>% + pivot_longer(c(used, size), names_to = 'metric') %>% mutate(value = round(value, 2)) %>% ggplot(aes( x = datetime, @@ -309,8 +309,8 @@ p <- disk_usage %>% geom_line(alpha = 0.7) + geom_point(aes(text = glue("{value} TiB"))) + scale_x_datetime(labels = date_format("%b %Y")) + - scale_color_brewer(palette = "Set1", - breaks = c('size', 'used', 'avail') # enforce order + scale_color_brewer(palette = "Set2", + breaks = c('size', 'used') # enforce order ) + labs(y = 'TiB', x = '') + theme(legend.title = element_blank()) @@ -322,7 +322,7 @@ card(ggplotly(p, tooltip = "text")) ## Summary over time Usage by top users for each spacesavers metric. -Only users with at least `r min_bytes_GiB` GiB of total disk usage are shown. +Only users with at least `r min_user_bytes_GiB` GiB of total disk usage are shown. ```{r summary_over_time} summary_dat_all <- user_dat %>% From ccd1450d3d575f8fcd5aba0284d94dddc46d9ffe Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Mon, 29 Jan 2024 14:51:49 -0500 Subject: [PATCH 2/2] feat: script to render plot without sending email --- bin/render.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 bin/render.sh diff --git a/bin/render.sh b/bin/render.sh new file mode 100644 index 0000000..33a5cf9 --- /dev/null +++ b/bin/render.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +# to be executed from /data/CCBR_Pipeliner/Tools/spacesavers2/report +# Usage: bash bin/render_report_biowulf.sh +module load singularity +SINGULARITY_CACHEDIR=/data/CCBR_Pipeliner/SIFS + +echo "cd /mnt && \ + Rscript bin/render.R \ + " |\ + singularity exec -C -B $PWD:/mnt,/data/CCBR_Pipeliner/userdata/spacesavers2/:/mnt/data docker://nciccbr/spacesavers2:0.1.1 bash