From 9aac00b4e56e5120e0694cfb612e42915eeee9ac Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Tue, 21 Mar 2023 11:28:02 +0100 Subject: [PATCH] Update weekly_stats_graphs.yaml --- .github/workflows/weekly_stats_graphs.yaml | 36 ++++++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/.github/workflows/weekly_stats_graphs.yaml b/.github/workflows/weekly_stats_graphs.yaml index 91971824f..9ff9cf46e 100644 --- a/.github/workflows/weekly_stats_graphs.yaml +++ b/.github/workflows/weekly_stats_graphs.yaml @@ -139,6 +139,7 @@ jobs: ) #plot for [i=1:*] 'Stats3' using 0:i rm Stats3 + - name: Create individual stats run: | # Prepare data @@ -164,13 +165,42 @@ jobs: }' Stats3 > StatsTmp && mv StatsTmp Stats3 # For each addon, create graph input="Stats3" - while IFS= read -r line - do + while IFS= read -r line; do TITLE="${line%% *}" - FOLDER="$(grep -rl "ghcr.io/alexbelgium/$TITLE-" */* | xargs dirname)" + FOLDER="$(grep -rl "ghcr.io/alexbelgium/$TITLE-" . | xargs dirname)" # if folder exists if [ -d "$FOLDER" ]; then echo "$TITLE" + # Plot graph + ( gnuplot-nox -persist <<-EOFMarker + set title "$TITLE" + set ylabel 'Number of installations' + set xdata time + set datafile missing "-" + set timefmt "%Y-%m-%d" + set format x "%y-%m-%d" + set datafile sep ' ' + set autoscale + set terminal png size 500,300 + set output "$FOLDER/stats.png" + set term png tiny + plot for [i=2:*] 'Stats3' using 1:i w l title columnhead(i) smooth csplines + EOFMarker + ) || ( gnuplot-nox -persist <<-EOFMarker + set title "$TITLE" + set ylabel 'Number of installations' + set xdata time + set datafile missing "-" + set timefmt "%Y-%m-%d" + set format x "%y-%m-%d" + set datafile sep ' ' + set autoscale + set terminal png size 500,300 + set output "$FOLDER/stats.png" + set term png tiny + plot for [i=2:*] 'Stats3' using 1:i w l title columnhead(i) + EOFMarker + ) fi done < "$input" # Clean files