From a8a59b479dee919349c62c826c1853a4592492b9 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Mon, 24 Sep 2018 20:25:53 +0000 Subject: [PATCH] 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 --- .../openstack_project/files/mirror/cache-stats.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/openstack_project/files/mirror/cache-stats.sh b/modules/openstack_project/files/mirror/cache-stats.sh index 7235c24d25..fe0d749223 100644 --- a/modules/openstack_project/files/mirror/cache-stats.sh +++ b/modules/openstack_project/files/mirror/cache-stats.sh @@ -1,11 +1,12 @@ #!/bin/bash -for X in 0 1 2 ; do - HITS=$(grep ' cache hit ' /var/log/apache2/${HOSTNAME}*_808${X}_access.log | wc -l) - REFRESHES=$(grep ' conditional cache hit: entity refreshed ' /var/log/apache2/${HOSTNAME}*_808${X}_access.log | wc -l) - MISSES=$(grep ' cache miss: ' /var/log/apache2/${HOSTNAME}*_808${X}_access.log | wc -l) +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 "Port 808${X} Cache Hits: $HITS" - echo "Port 808${X} Cache Refresshes: $REFRESHES" - echo "Port 808${X} Cache Misses: $MISSES" + echo "${X}" + echo "Cache Hits: $HITS" + echo "Cache Refresshes: $REFRESHES" + echo "Cache Misses: $MISSES" echo "" done