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