From cbd02519cff8ee0b4d586219abcc3979222414ff Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Tue, 21 Mar 2023 23:01:28 +0100 Subject: [PATCH] Update helper_stats_graphs.yaml --- .github/workflows/helper_stats_graphs.yaml | 91 +++++++++++----------- 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/.github/workflows/helper_stats_graphs.yaml b/.github/workflows/helper_stats_graphs.yaml index c5ff715a4..13323e0c3 100644 --- a/.github/workflows/helper_stats_graphs.yaml +++ b/.github/workflows/helper_stats_graphs.yaml @@ -19,49 +19,6 @@ jobs: git pull --rebase origin master sudo apt-get install gawk -y sudo apt-get install gnuplot-nox -y - - name: Create global stats - run: | - # Prepare data - cp Stats Stats3 - # Inverse file - gawk -i inplace '{for(i=NF;i>1;i--)printf "%s ",$i;printf "%s",$1;print ""}' Stats3 - # Only totals - head -n 2 Stats3 > tmp_file && mv tmp_file Stats3 - # Transpose data - awk ' - { - for (i=1; i<=NF; i++) { - a[NR,i] = $i - } - } - NF>p { p = NF } - END { - for(j=1; j<=p; j++) { - str=a[1,j] - for(i=2; i<=NR; i++){ - str=str" "a[i,j]; - } - print str - } - }' Stats3 > StatsTmp && mv StatsTmp Stats3 - sed -i "1d" Stats3 - # Plot graph - gnuplot-nox -persist <<-EOFMarker - set title 'Total addons' - 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 key top left autotitle columnheader - set autoscale - set terminal png size 500,300 - set output 'stats.png' - set term png tiny - plot 'Stats3' using 1:2 lt rgb 'red' w l title 'Total addons' smooth bezier - EOFMarker - rm Stats3 - name: Create addons stats run: | # Prepare data @@ -217,9 +174,53 @@ jobs: done # Clean files rm Stats3 - + - name: Create global stats + run: | + # Prepare data + cp Stats Stats3 + # Inverse file + gawk -i inplace '{for(i=NF;i>1;i--)printf "%s ",$i;printf "%s",$1;print ""}' Stats3 + # Only totals + head -n 2 Stats3 > tmp_file && mv tmp_file Stats3 + # Transpose data + awk ' + { + for (i=1; i<=NF; i++) { + a[NR,i] = $i + } + } + NF>p { p = NF } + END { + for(j=1; j<=p; j++) { + str=a[1,j] + for(i=2; i<=NR; i++){ + str=str" "a[i,j]; + } + print str + } + }' Stats3 > StatsTmp && mv StatsTmp Stats3 + sed -i "1d" Stats3 + # Plot graph + gnuplot-nox -persist <<-EOFMarker + set title 'Total addons' + 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 key top left autotitle columnheader + set autoscale + set terminal png size 500,300 + set output 'stats.png' + set term png tiny + plot 'Stats3' using 1:2 lt rgb 'red' w l title 'Total addons' smooth bezier + EOFMarker + rm Stats3 - name: Commit if needed uses: EndBug/add-and-commit@v9 with: - message: "GitHub bot : README updated" + message: "GitHub bot : graphs updated" + default_author: github_actions + default_author: github_actions