Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
e740b9b7
Commit
e740b9b7
authored
Jan 30, 2020
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update azbyka_stat
parent
61989110
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
15 deletions
+28
-15
url_a.sh
web/azbyka_stat/url_a.sh
+12
-2
url_a_p.1.sh
web/azbyka_stat/url_a_p.1.sh
+4
-9
url_a_p.sh
web/azbyka_stat/url_a_p.sh
+11
-3
url_stats.sh
web/url_stats.sh
+1
-1
No files found.
web/azbyka_stat/url_a.sh
View file @
e740b9b7
#!/bin/sh
#!/bin/sh
P
=
$(
pwd
)
P
=
$(
pwd
)
cd
..
cd
..
TODAY
=
$(
date
"+%d/%b/%Y"
)
filter_today
()
{
grep
"
\[
$TODAY
"
}
for
i
in
/var/log/nginx/
*
access.log
;
do
for
i
in
/var/log/nginx/
*
access.log
;
do
[
"
$i
"
=
/var/log/nginx/azbyka.ru-access.log
]
&&
continue
grep
-q
"
$i
"
$P
/skipped.list
&&
continue
./url_stats.sh
$i
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
cp
-f
url_report.txt
$P
/
$0
.
$(
basename
$i
)
.stat
rm
-f
$i
.tmp
done
done
web/azbyka_stat/url_a_p.1.sh
View file @
e740b9b7
...
@@ -6,7 +6,7 @@ while read per overall count mid url ; do
...
@@ -6,7 +6,7 @@ while read per overall count mid url ; do
mid
=
$(
echo
$mid
|
sed
-e
"s|
\.
.*||g"
)
mid
=
$(
echo
$mid
|
sed
-e
"s|
\.
.*||g"
)
echo
"|-"
echo
"|-"
echo
"|
$ST
|
$per
||
$ST
|
$overall
||
$ST
|
$count
||
$ST
|
$mid
||
$url
"
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
NS
=
/var/local/nginx-stat/stat-projects.html
...
@@ -23,28 +23,23 @@ $(date)
...
@@ -23,28 +23,23 @@ $(date)
<table border="0">
<table border="0">
<tr>
<tr>
<td style="text-align:center;"> % от
<p>проекта
</p>
</td>
<td style="text-align:center;">Общее время,
<td style="text-align:center;">Общее время,
<
p
>сек
<
br
>сек
</p>
</p>
</td>
</td>
<td style="text-align:center;">Кол-во запросов
<td style="text-align:center;">Кол-во запросов
</td>
</td>
<td style="text-align:center;">Среднее время
<td style="text-align:center;">Среднее время
<
p
>запроса, мс</p>
<
br
>запроса, мс</p>
</td>
</td>
<td style="text-align:center;">URL
<td style="text-align:center;">URL
</td></tr>
</td></tr>
EOF
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"
)
overall
=
$(
echo
$overall
|
sed
-e
"s|
\.
.*||g"
)
mid
=
$(
echo
$mid
|
sed
-e
"s|
\.
.*||g"
)
mid
=
$(
echo
$mid
|
sed
-e
"s|
\.
.*||g"
)
echo
"<tr>"
echo
"<tr>"
echo
"<td style=
\"
text-align:right;
\"
>
$per
</td>"
echo
"<td style=
\"
text-align:right;
\"
>
$overall
</td>"
echo
"<td style=
\"
text-align:right;
\"
>
$overall
</td>"
echo
"<td style=
\"
text-align:right;
\"
>
$count
</td>"
echo
"<td style=
\"
text-align:right;
\"
>
$count
</td>"
echo
"<td style=
\"
text-align:right;
\"
>
$mid
</td>"
echo
"<td style=
\"
text-align:right;
\"
>
$mid
</td>"
...
...
web/azbyka_stat/url_a_p.sh
View file @
e740b9b7
#!/bin/sh
#!/bin/sh
P
=
$(
pwd
)
P
=
$(
pwd
)
cd
..
cd
..
TODAY
=
$(
date
"+%d/%b/%Y"
)
filter_today
()
{
grep
"
\[
$TODAY
"
}
for
i
in
/var/log/nginx/azbyka_
*
access.log
;
do
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
#./url_stats_project.sh $i
#cp -f url_report.txt $P/$0.$(basename $i).stat
#cp -f url_report.txt $P/$0.$(basename $i).stat
./url_stats_project.py <
$i
cat
$i
| filter_today | ./url_stats_project.py
done
>
$P
/
$0
.azbyka.stat
done
>
$P
/
$0
.azbyka.stat
.total
web/url_stats.sh
View file @
e740b9b7
...
@@ -7,6 +7,6 @@ test -z "$1" || FILE="$1"
...
@@ -7,6 +7,6 @@ test -z "$1" || FILE="$1"
echo
"=== Requests which took most of the time (from
$FILE
) ==="
>
url_report.txt
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
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
#grep "\[25/Dec/2010:" "$FILE" | ./url_stats.py >> url_report.txt
#cat /tmp/report.txt | mail -s "url performance report" root
#cat /tmp/report.txt | mail -s "url performance report" root
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment