Commit e740b9b7 authored by Vitaly Lipatov's avatar Vitaly Lipatov

update azbyka_stat

parent 61989110
#!/bin/sh
P=$(pwd)
cd ..
TODAY=$(date "+%d/%b/%Y")
filter_today()
{
grep "\[$TODAY"
}
for i in /var/log/nginx/*access.log ; do
[ "$i" = /var/log/nginx/azbyka.ru-access.log ] && continue
./url_stats.sh $i
grep -q "$i" $P/skipped.list && continue
echo "$i" | grep -q "redir" && continue
cat $i | filter_today >$i.tmp
./url_stats.sh $i.tmp
cp -f url_report.txt $P/$0.$(basename $i).stat
rm -f $i.tmp
done
......@@ -6,7 +6,7 @@ while read per overall count mid url ; do
mid=$(echo $mid | sed -e "s|\..*||g")
echo "|-"
echo "| $ST | $per || $ST | $overall || $ST | $count || $ST | $mid || $url"
done < url_a_p.sh.azbyka.stat >$0.outwiki
done < url_a_p.sh.azbyka.stat.total >$0.outwiki
NS=/var/local/nginx-stat/stat-projects.html
......@@ -23,28 +23,23 @@ $(date)
<table border="0">
<tr>
<td style="text-align:center;">&#160;% от
<p>проекта
</p>
</td>
<td style="text-align:center;">Общее время,
<p>сек
<br>сек
</p>
</td>
<td style="text-align:center;">Кол-во запросов
</td>
<td style="text-align:center;">Среднее время
<p>запроса, мс</p>
<br>запроса, мс</p>
</td>
<td style="text-align:center;">URL
</td></tr>
EOF
cat url_a_p.sh.azbyka.stat | while read per overall count mid url ; do
cat url_a_p.sh.azbyka.stat.total | sort -t" " -rn -k2 | while read per overall count mid url ; do
overall=$(echo $overall | sed -e "s|\..*||g")
mid=$(echo $mid | sed -e "s|\..*||g")
echo "<tr>"
echo "<td style=\"text-align:right;\">$per</td>"
echo "<td style=\"text-align:right;\">$overall</td>"
echo "<td style=\"text-align:right;\">$count</td>"
echo "<td style=\"text-align:right;\">$mid</td>"
......
#!/bin/sh
P=$(pwd)
cd ..
TODAY=$(date "+%d/%b/%Y")
filter_today()
{
grep "\[$TODAY"
}
for i in /var/log/nginx/azbyka_*access.log ; do
[ "$i" = /var/log/nginx/azbyka.ru-access.log ] && continue
grep -q "$i" $P/skipped.list && continue
echo "$i" | grep -q "redir" && continue
#./url_stats_project.sh $i
#cp -f url_report.txt $P/$0.$(basename $i).stat
./url_stats_project.py <$i
done >$P/$0.azbyka.stat
cat $i | filter_today | ./url_stats_project.py
done >$P/$0.azbyka.stat.total
......@@ -7,6 +7,6 @@ test -z "$1" || FILE="$1"
echo "=== Requests which took most of the time (from $FILE) ===" > url_report.txt
echo "percent - overall time - number of requests - average time - url" >> url_report.txt
cat "$FILE" | ./url_stats.py >> url_report.txt
cat $FILE | ./url_stats.py >> url_report.txt
#grep "\[25/Dec/2010:" "$FILE" | ./url_stats.py >> url_report.txt
#cat /tmp/report.txt | mail -s "url performance report" root
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment