From Fedora Project Wiki
(→Yum) |
|||
(8 intermediate revisions by 4 users not shown) | |||
Line 2: | Line 2: | ||
= Yum = | = Yum = | ||
== New Way == | |||
SSH to log1 and: | |||
cat /srv/www/fedoraUsage/updates-released-f{{FedoraVersion}} | |||
NOTE: The script used to produce this file is in the [http://git.fedorahosted.org/git/?p=fedora-infrastructure.git;a=tree;f=scripts/fedoraUsage;h=79efccda909b1a17baefe5689498b3b212ec6419;hb=HEAD fedora-infrastructure.git repo] which is publicly accessible | |||
A collection of scripts currently used on the logging host as a personal cronjob can be found here: | |||
[http://pfrields.fedorapeople.org/scripts/fedora-statistics-scripts.tar.gz] | |||
== Old Way (deprecated) == | |||
SSH to lockbox and: | SSH to lockbox and: | ||
egrep 'repo=updates-released-f9' \ | egrep 'repo=updates-released-f9' \ | ||
Line 9: | Line 19: | ||
= Direct Downloads = | = Direct Downloads = | ||
SSH to | SSH to log1 and: | ||
egrep 'Fedora- | |||
egrep 'Fedora-{{FedoraVersion}}.*\.iso' \ | |||
/var/log/hosts/proxy*/YYYY/MM/DD/http/download.fedoraproject.org-access.log | \ | |||
grep '\" 302 ' | awk '{print $1}' | awk -F : '{print $2}' | sort | uniq | wc -l \ | grep '\" 302 ' | awk '{print $1}' | awk -F : '{print $2}' | sort | uniq | wc -l \ | ||
> ~/ | > ~/f{{FedoraVersion}}-dl-$(date +%Y%m%d).txt | ||
This script appears to work well: | |||
<pre> | |||
#!/bin/bash | |||
# | |||
[ -n "$NDAYS" ] || NDAYS=7 | |||
[ -n "$RELEASE" ] || RELEASE=10 | |||
for D in $(seq $NDAYS -1 1) | |||
do | |||
YEAR=`date -d "$D days ago" +"%Y"` | |||
MONTH=`date -d "$D days ago" +"%m"` | |||
DAY=`date -d "$D days ago" +"%d"` | |||
egrep "Fedora-$RELEASE.*\.iso" \ | |||
/var/log/hosts/proxy*/${YEAR}/${MONTH}/${DAY}/http/download.fedoraproject.org-access.log | \ | |||
grep '\" 302 ' | awk '{print $1}' | awk -F : '{print $2}' | \ | |||
sort | uniq | wc -l \ | |||
> ~/f${RELEASE}-dl-${YEAR}${MONTH}${DAY}.txt | |||
done | |||
</pre> | |||
= Fedoraproject.org Visits = | = Fedoraproject.org Visits = | ||
Go [http://lockbox.fedora.phx.redhat.com/awstats/ here]. Also, for example: | |||
for month in `seq -w 9 10`; do echo -n "$month "; (bzcat \ | |||
/var/log/hosts/proxy[1-5]/2008/$month/*/http/fedoraproject.org-access.* \ | |||
2> /dev/null || cat \ | |||
/var/log/hosts/proxy[1-5]/2008/$month/*/http/fedoraproject.org-access.*) | \ | |||
awk '{print $1 }' | sort | uniq | wc -l ; done | |||
= Wiki Edits = | = Wiki Edits = | ||
for month in `seq -w 5 10`; do echo -n "$month "; (bzgrep -hce 'POST.*edit' \ | |||
/var/log/hosts/proxy[1-5]/2008/$month/*/http/fedoraproject.org-access.* \ | |||
2> /dev/null || grep -hce 'POST.*edit' \ | |||
/var/log/hosts/proxy[1-5]/2008/$month/*/http/fedoraproject.org-access.*) | \ | |||
awk '{ s+=$1 } END { print "Total: "s}'; done |
Revision as of 18:47, 20 July 2011
These are the command line recipes for the metrics shown on the Statistics page.
Yum
New Way
SSH to log1 and:
cat /srv/www/fedoraUsage/updates-released-f39
NOTE: The script used to produce this file is in the fedora-infrastructure.git repo which is publicly accessible
A collection of scripts currently used on the logging host as a personal cronjob can be found here: [1]
Old Way (deprecated)
SSH to lockbox and:
egrep 'repo=updates-released-f9' \ /var/log/httpd/archives/proxy*/mirrors.fedoraproject.org-access.log.<date_range> | \ grep '\" 200 ' | awk '{print $1}' | awk -F : '{print $2}' | \ sort | uniq | wc -l > ~/f9-yum-<end_date>.txt
Direct Downloads
SSH to log1 and:
egrep 'Fedora-39.*\.iso' \ /var/log/hosts/proxy*/YYYY/MM/DD/http/download.fedoraproject.org-access.log | \ grep '\" 302 ' | awk '{print $1}' | awk -F : '{print $2}' | sort | uniq | wc -l \ > ~/f39-dl-$(date +%Y%m%d).txt
This script appears to work well:
#!/bin/bash # [ -n "$NDAYS" ] || NDAYS=7 [ -n "$RELEASE" ] || RELEASE=10 for D in $(seq $NDAYS -1 1) do YEAR=`date -d "$D days ago" +"%Y"` MONTH=`date -d "$D days ago" +"%m"` DAY=`date -d "$D days ago" +"%d"` egrep "Fedora-$RELEASE.*\.iso" \ /var/log/hosts/proxy*/${YEAR}/${MONTH}/${DAY}/http/download.fedoraproject.org-access.log | \ grep '\" 302 ' | awk '{print $1}' | awk -F : '{print $2}' | \ sort | uniq | wc -l \ > ~/f${RELEASE}-dl-${YEAR}${MONTH}${DAY}.txt done
Fedoraproject.org Visits
Go here. Also, for example:
for month in seq -w 9 10
; do echo -n "$month "; (bzcat \
/var/log/hosts/proxy[1-5]/2008/$month/*/http/fedoraproject.org-access.* \
2> /dev/null || cat \
/var/log/hosts/proxy[1-5]/2008/$month/*/http/fedoraproject.org-access.*) | \
awk '{print $1 }' | sort | uniq | wc -l ; done
Wiki Edits
for month in seq -w 5 10
; do echo -n "$month "; (bzgrep -hce 'POST.*edit' \
/var/log/hosts/proxy[1-5]/2008/$month/*/http/fedoraproject.org-access.* \
2> /dev/null || grep -hce 'POST.*edit' \
/var/log/hosts/proxy[1-5]/2008/$month/*/http/fedoraproject.org-access.*) | \
awk '{ s+=$1 } END { print "Total: "s}'; done