system-config/playbooks/roles/mirror-update/files/cache-stats.sh
Ian Wienand b85282c046 Move rsync mirror updates to new opendev.org mirror-update host
This move was prompted by wishing to expose the mirror update logs for
the rsync updates so that debugging problems does not require a root
user (note: not actually done in this change; will be a follow-on).

Rather than start hacking at puppet, the rsync mirror scripts make a
nice delination point for starting an Ansible-first/Bionic update.

Most magic is included in the scripts, so there is not much more to do
than copy them.  The host uses the existing kerberos and openafs roles
and copies the key material into place (to be added before merge).

Note the scripts are removed from the extant puppet so we don't have
two updates happening simultaneously.  This will also require a manual
clean to remove the cron jobs as a once-off when merging.

The other part of mirror-update is the reprepro based scripts for the
various debuntu repositories.  They are left as future work for now.

Testing is added to ensure dependencies and scripts are all in place.

Change-Id: I525ac18b55f0e11b0a541b51fa97ee5d6512bf70
2019-07-02 16:42:33 +10:00

13 lines
374 B
Bash
Executable File

#!/bin/bash
for X in /var/log/apache2/${HOSTNAME}*_access.log ; do
HITS=$(grep ' cache hit ' ${X} | wc -l)
REFRESHES=$(grep ' conditional cache hit: entity refreshed ' ${X} | wc -l)
MISSES=$(grep ' cache miss: ' ${X} | wc -l)
echo "${X}"
echo "Cache Hits: $HITS"
echo "Cache Refresshes: $REFRESHES"
echo "Cache Misses: $MISSES"
echo ""
done