system-config/modules/openstack_project/files/mirror/cache-stats.sh
Jeremy Stanley a8a59b479d Update cache-stats.sh to include the port 80 proxy
Adding cache stats for port 80 requires a little refactoring to
account for the lack of a port number in the 80/tcp (default port)
proxy logs. This also slightly alters the output for the sake of
keeping the script simple.

Change-Id: I431a54445ff5bcb7f4a38bd30b73f00e4d7892f7
2018-09-24 20:31:05 +00:00

13 lines
374 B
Bash

#!/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