mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-08 06:50:58 +02:00
Update and rename weekly_stats_graphs.yaml to helper_stats_graphs.yaml
This commit is contained in:
@@ -2,8 +2,10 @@
|
|||||||
---
|
---
|
||||||
name: Generate weekly stats graphs
|
name: Generate weekly stats graphs
|
||||||
on:
|
on:
|
||||||
schedule:
|
workflow_run:
|
||||||
- cron: "0 13 * * 5"
|
workflows: ["weekly_stats.yaml"]
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -172,38 +174,39 @@ jobs:
|
|||||||
FOLDER="$(grep -rl "ghcr.io/alexbelgium/$TITLE-" . | xargs dirname)" || echo "$TITLE not found"
|
FOLDER="$(grep -rl "ghcr.io/alexbelgium/$TITLE-" . | xargs dirname)" || echo "$TITLE not found"
|
||||||
# if folder exists
|
# if folder exists
|
||||||
if [ -d "$FOLDER" ]; then
|
if [ -d "$FOLDER" ]; then
|
||||||
echo "$TITLE"
|
echo "$TITLE"
|
||||||
# Plot graph
|
# Plot graph
|
||||||
( gnuplot-nox -persist <<-EOFMarker
|
( gnuplot-nox -persist <<-EOFMarker
|
||||||
set title "$TITLE"
|
set title "$TITLE"
|
||||||
set ylabel 'Number of installations'
|
set ylabel 'Number of installations'
|
||||||
set xdata time
|
set xdata time
|
||||||
set datafile missing "-"
|
set datafile missing "-"
|
||||||
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 autoscale
|
set autoscale
|
||||||
set terminal png size 500,300
|
set terminal png size 500,300
|
||||||
set output "$FOLDER/stats.png"
|
set output "$FOLDER/stats.png"
|
||||||
set term png tiny
|
set term png tiny
|
||||||
plot for [i=2:*] 'Stats3' using 1:i w l title columnhead(i) smooth csplines
|
plot for [i=2:*] 'Stats3' using 1:i w l title columnhead(i) smooth csplines
|
||||||
EOFMarker
|
EOFMarker
|
||||||
) || ( gnuplot-nox -persist <<-EOFMarker
|
) || ( gnuplot-nox -persist <<-EOFMarker
|
||||||
set title "$TITLE"
|
set title "$TITLE"
|
||||||
set ylabel 'Number of installations'
|
set ylabel 'Number of installations'
|
||||||
set xdata time
|
set xdata time
|
||||||
set datafile missing "-"
|
set datafile missing "-"
|
||||||
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 autoscale
|
set autoscale
|
||||||
set terminal png size 500,300
|
set terminal png size 500,300
|
||||||
set output "$FOLDER/stats.png"
|
set output "$FOLDER/stats.png"
|
||||||
set term png tiny
|
set term png tiny
|
||||||
plot for [i=2:*] 'Stats3' using 1:i w l title columnhead(i)
|
plot for [i=2:*] 'Stats3' using 1:i w l title columnhead(i)
|
||||||
EOFMarker
|
EOFMarker
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
# Clean files
|
# Clean files
|
||||||
rm Stats3
|
rm Stats3
|
||||||
|
|
||||||
Reference in New Issue
Block a user