Add some stats tracking
This commit is contained in:
parent
14c4feb9df
commit
425f3fef7a
23
rowbot
23
rowbot
|
@ -1,5 +1,23 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
###
|
||||||
|
# stats
|
||||||
|
###
|
||||||
|
|
||||||
|
if [[ ! -v START_TIME ]]; then
|
||||||
|
export START_TIME
|
||||||
|
printf -v START_TIME '%(%s)T' -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -v RELOADED ]]; then
|
||||||
|
(( RELOADED += 1 ))
|
||||||
|
else
|
||||||
|
export RELOADED=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
export LAST_RELOAD
|
||||||
|
printf -v LAST_RELOAD '%(%s)T' -1
|
||||||
|
|
||||||
###
|
###
|
||||||
# switch toggler
|
# switch toggler
|
||||||
###
|
###
|
||||||
|
@ -939,6 +957,11 @@ hook_cmd_control_panel() {
|
||||||
read -r msg <<< "$msg"
|
read -r msg <<< "$msg"
|
||||||
privmsg "$recipient" "$msg"
|
privmsg "$recipient" "$msg"
|
||||||
privmsg "$to" "sent message to $recipient"
|
privmsg "$to" "sent message to $recipient"
|
||||||
|
;;
|
||||||
|
stats)
|
||||||
|
privmsg "$to" "running since $(printf '%(%c)T' "$START_TIME")"
|
||||||
|
privmsg "$to" "last reload at $(printf '%(%c)T' "$LAST_RELOAD")"
|
||||||
|
privmsg "$to" "reloaded $RELOADED times"
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue