Initial commit
This commit is contained in:
commit
3b0eda764c
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/zsh
|
||||||
|
QUEUE="$(curl -sSL 'https://2b2t.io/api/queue?range=1h')"
|
||||||
|
PRIO="$(curl -sSL 'https://2b2t.io/api/prioqueue?range=1h')"
|
||||||
|
PLAY="$(curl -sSL 'https://2b2t.io/api/pingstats?range=1h')"
|
||||||
|
|
||||||
|
function gnuplot-parsable {
|
||||||
|
for ((i=0; i<$(print $1 | jq ".|length");i++)); do
|
||||||
|
printf "%s\t%s\n" $(print $1 | jq ".[$i][0]") $(print $1 | jq ".[$i][1]");
|
||||||
|
done
|
||||||
|
}
|
||||||
|
gnuplot-parsable "$QUEUE" > queuedata
|
||||||
|
gnuplot-parsable "$PRIO" > priodata
|
||||||
|
gnuplot-parsable "$PLAY" > playerdata
|
|
@ -0,0 +1,7 @@
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%s"
|
||||||
|
set grid
|
||||||
|
set terminal pngcairo size 1000,1000
|
||||||
|
set output 'graph.png'
|
||||||
|
f(x)=sprintf("%d", x)
|
||||||
|
plot "queuedata" u (f($1)):2 w lp title "Queue", "priodata" u (f($1)):2 w lp title "Priority Queue", "playerdata" u (f($1)):2 w lp title "Players"
|
Loading…
Reference in New Issue