Next medal / level estimation
This commit is contained in:
parent
d9e801110d
commit
4484f591b1
30
graph
30
graph
@ -411,7 +411,15 @@ else
|
||||
AREA:arealvl15#$L15color
|
||||
AREA:arealvl16#$L16color
|
||||
)
|
||||
else
|
||||
next=(
|
||||
CDEF:next=data,POP,last,${lvl[2]},LT,${lvl[2]},last,${lvl[3]},LT,${lvl[3]},last,${lvl[4]},LT,${lvl[4]},last,${lvl[5]},LT,${lvl[5]},last,${lvl[6]},LT,${lvl[6]},last,${lvl[7]},LT,${lvl[7]},last,${lvl[8]},LT,${lvl[8]},last,${lvl[9]},LT,${lvl[9]},last,${lvl[10]},LT,${lvl[10]},last,${lvl[11]},LT,${lvl[11]},last,${lvl[12]},LT,${lvl[12]},last,${lvl[13]},LT,${lvl[13]},last,${lvl[14]},LT,${lvl[14]},last,${lvl[15]},LT,${lvl[15]},last,${lvl[16]},LT,${lvl[16]},UNKN,IF,IF,IF,IF,IF,IF,IF,IF,IF,IF,IF,IF,IF,IF,IF
|
||||
CDEF:nextcross=pred,next,GE,pred,UNKN,IF
|
||||
VDEF:nexttime=nextcross,FIRST
|
||||
'GPRINT:next:LAST:\tnext %6.2lf%s'
|
||||
'GPRINT:nexttime:(%Y-%m-%d)\n:strftime'
|
||||
)
|
||||
elif (( bronze["$graph"] ))
|
||||
then
|
||||
thresholds=(
|
||||
COMMENT:'Medals\:'
|
||||
HRULE:${bronze["$graph"]}#A02020:${bronze["$graph"]}
|
||||
@ -444,18 +452,33 @@ else
|
||||
AREA:areaplatinum#505050
|
||||
AREA:areablack#101010
|
||||
)
|
||||
next=(
|
||||
CDEF:next=data,POP,last,${bronze["$graph"]},LT,${bronze["$graph"]},last,${silver["$graph"]},LT,${silver["$graph"]},last,${gold["$graph"]},LT,${gold["$graph"]},last,${platinum["$graph"]},LT,${platinum["$graph"]},last,${black["$graph"]},LT,${black["$graph"]},UNKN,IF,IF,IF,IF,IF
|
||||
CDEF:nextcross=pred,next,GE,pred,UNKN,IF
|
||||
VDEF:nexttime=nextcross,FIRST
|
||||
'GPRINT:next:LAST:\tnext %6.2lf%s'
|
||||
'GPRINT:nexttime:(%Y-%m-%d)\n:strftime'
|
||||
)
|
||||
else
|
||||
thresholds=()
|
||||
draw=()
|
||||
next=('COMMENT:\n')
|
||||
fi
|
||||
|
||||
(( start > -1209600 )) && datastart=-1209600
|
||||
(( end < 157680001 )) && dataend="+157680001"
|
||||
(( start > 0 )) && start="+$start"
|
||||
(( end > 0 )) && end="+$end"
|
||||
(( datastart > 0 )) && datastart="+$datastart"
|
||||
|
||||
rrdtool graph - \
|
||||
-a PNG \
|
||||
-w $graph_width \
|
||||
-v $graph \
|
||||
-s $start -e $end \
|
||||
DEF:data=$rrdfile:$graph:AVERAGE:step=3600${datastart+:start=$datastart} \
|
||||
DEF:data=$rrdfile:$graph:AVERAGE:step=3600${datastart+:start=$datastart}${dataend+:end=$dataend} \
|
||||
DEF:fail=$rrdfile:$graph:FAILURES \
|
||||
VDEF:last=data,LAST \
|
||||
VDEF:intercept=data,LSLINT \
|
||||
VDEF:growth=data,LSLSLOPE \
|
||||
CDEF:trend=data,POP,COUNT,growth,*,intercept,+ \
|
||||
@ -466,7 +489,6 @@ else
|
||||
TICK:fail#ffffa0:1.0 \
|
||||
VRULE:$now#000000 \
|
||||
'GPRINT:data:MIN:min %6.2lf%S' \
|
||||
'GPRINT:data:AVERAGE:\tavg %6.2lf%S' \
|
||||
'GPRINT:data:MAX:\tmax %6.2lf%S' \
|
||||
'GPRINT:growth:\tgrowth %6.2lf%s/h\n'
|
||||
"${next[@]}"
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user