Update weekly_stats.yaml

This commit is contained in:
Alexandre
2023-01-09 15:26:46 +01:00
committed by GitHub
parent 0199917e90
commit 88f770744a

View File

@@ -105,11 +105,14 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Create stats
- name: Install apps
run: |
sudo apt-get install gawk -y
sudo apt-get install gnuplot-nox -y
- name: Create global stats
run: |
# Prepare data
cp Stats Stats3
sudo apt-get install gawk -y
# Inverse file
gawk -i inplace '{for(i=NF;i>1;i--)printf "%s ",$i;printf "%s",$1;print ""}' Stats3
# Only totals
@@ -133,23 +136,61 @@ jobs:
}' Stats3 > StatsTmp && mv StatsTmp Stats3
sed -i "1d" Stats3
# Plot graph
sudo apt-get install gnuplot-nox -y
gnuplot-nox -persist <<-EOFMarker
set title 'Total addons'
set ylabel 'Number of installations'
#set xlabel 'Día'
set xdata time
set timefmt "%Y-%m-%d"
set format x "%y-%m-%d"
set datafile sep ' '
set key top left autotitle columnheader
#set grid
set autoscale
set terminal png size 500,300
set output 'stats.png'
plot 'Stats3' using 1:2 lt rgb 'red' w l title 'Total addons'
EOFMarker
rm Stats3
- name: Create addons stats
run: |
# Prepare data
cp Stats Stats3
# Remove Totals
sed -i "2d" Stats3
# Inverse file
gawk -i inplace '{for(i=NF;i>1;i--)printf "%s ",$i;printf "%s",$1;print ""}' 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 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_addons.png'
plot for [i=1:*] 'Stats3' using 0:i
EOFMarker
rm Stats3
- name: Commit if needed
uses: EndBug/add-and-commit@v9
with: