diff options
author | Bill <bill@billserver.senders.io> | 2021-04-09 23:51:27 -0400 |
---|---|---|
committer | Bill <bill@billserver.senders.io> | 2021-04-09 23:51:27 -0400 |
commit | 7bdc85cd8cc2ce2d1bf7b573c5f6622cffa1029e (patch) | |
tree | 0c149a432e796e5b2e0633a24fa86dc823544770 /stats | |
parent | 8543c16f512a4e072330cccb6c528b5ed5b93ad0 (diff) |
Add a larger view into stats
Diffstat (limited to 'stats')
-rwxr-xr-x | stats/calc.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/stats/calc.sh b/stats/calc.sh index 9567247..8734a18 100755 --- a/stats/calc.sh +++ b/stats/calc.sh @@ -9,6 +9,7 @@ if [ $# -lt 2 ]; then " fi +# Stats for today TODAY=$(date -Id) echo -e "Stats for day:\t$TODAY" > $OUTFILE echo -e " Total Reqs:\t"$(grep 'OUT' ${LOGFILE} | grep "${TODAY}" | wc -l) >> $OUTFILE @@ -16,6 +17,16 @@ echo -e " Gemlog Reads:\t"$(grep 'IN' ${LOGFILE} | grep "${TODAY}" | grep "gemlo echo "Top 5 Gemlogs" >> $OUTFILE echo "--------------" >> $OUTFILE grep "IN" ${LOGFILE} | grep "${TODAY}" | cut -f4 | grep "gemlog" | grep ".gmi" | sort | uniq -c | sort -rn | head -n5 >> $OUTFILE -echo -e "\n// generated $(date -u -Is)" >> $OUTFILE +# Stats total +EARLIEST=$(head -n1 $LOGFILE | cut -f1) +echo "" >> $OUTFILE +echo -e " Stats since:\t$EARLIEST" >> $OUTFILE +echo -e " Total Reqs:\t"$(grep 'OUT' ${LOGFILE} | wc -l) >> $OUTFILE +echo -e " Gemlog Reads:\t"$(grep 'IN' ${LOGFILE} | grep "gemlog" | grep "gmi" | wc -l) >> $OUTFILE +echo "Top 5 Gemlogs" >> $OUTFILE +echo "--------------" >> $OUTFILE +grep "IN" ${LOGFILE} | cut -f4 | grep "gemlog" | grep ".gmi" | sort | uniq -c | sort -rn | head -n5 >> $OUTFILE +# print generating timestamp +echo -e "\n// generated $(date -u -Is)" >> $OUTFILE |