repo.or.cz
/
netbsd-mini2440.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
No empty .Rs/.Re
[netbsd-mini2440.git]
/
crypto
/
dist
/
ipsec-tools
/
src
/
racoon
/
stats.pl
blob
f509512ef7d6fa87f42a62c554e9ef58a3fb0b55
1
#!/usr/bin/perl
2
# usage:
3
# % cat /var/log/racoon-stats.log | perl stats.pl
4
5
while
(<
STDIN
>) {
6
chomp
;
7
(
$a
,
$a
,
$a
,
$a
,
$a
,
$b
) =
split
(
/\s+/
,
$_
,
6
);
8
(
$a
,
$c
) =
split
(
/:/
,
$b
,
2
);
9
$r
{
$a
} +=
$c
;
10
$t
{
$a
}++;
11
}
12
13
foreach
(
sort keys
%t
) {
14
printf
"
%s
: total=
%d
avg=
%8
.6f
\n
"
,
$_
,
$t
{
$_
},
$r
{
$_
}/
$t
{
$_
};
15
}