add type DERIVE for variables, because we are using counters, fix missing space
use graph_total instead of own $total variable
Revert "use graph_total instead of own $total variable"

This reverts commit fef9b225afdccffbd3146e34f3907eeb1f718439.