Last change
on this file since 146 was 2, checked in by Rick van der Zwet, 15 years ago |
Initial import of data of old repository ('data') worth keeping (e.g. tracking
means of URL access statistics)
|
-
Property svn:executable
set to
*
|
File size:
745 bytes
|
Rev | Line | |
---|
[2] | 1 | #!/usr/bin/env perl
|
---|
| 2 | do "common.pl";
|
---|
| 3 |
|
---|
| 4 | %bandwidth;
|
---|
| 5 |
|
---|
| 6 | open(FILE,$file);
|
---|
| 7 | while(<FILE>) {
|
---|
| 8 | /\S*\ \S*\ \S*\ \S*\ \S*\ \S*\ (\S*)\ \S*\ \S*\ (\S*)/;
|
---|
| 9 | $url = $1;
|
---|
| 10 | $size= $2;
|
---|
| 11 | if ( $size eq "-" ) { $size = 0 };
|
---|
| 12 | $bandwidth{$url} =+ $size;
|
---|
| 13 |
|
---|
| 14 | }
|
---|
| 15 | close(FILE);
|
---|
| 16 |
|
---|
| 17 | $total;
|
---|
| 18 | @tmp;
|
---|
| 19 | @toplisting;
|
---|
| 20 |
|
---|
| 21 | foreach $url (sort { $bandwidth{$b} <=> $bandwidth{$a}; } keys %bandwidth) {
|
---|
| 22 | push(@toplisting, $url);
|
---|
| 23 | $total = $total + $bandwidth{$url};
|
---|
| 24 | # Manual search remaining agents
|
---|
| 25 | # else {
|
---|
| 26 | # print $agent;
|
---|
| 27 | # }
|
---|
| 28 | }
|
---|
| 29 |
|
---|
| 30 | print "Total Bandwidth (bytes): $total\n";
|
---|
| 31 | print "top 10 bandwidth\n";
|
---|
| 32 | foreach $i (0 .. 9 ) {
|
---|
| 33 | print $i + 1, ": $toplisting[$i] \[$bandwidth{$toplisting[$i]} ",
|
---|
| 34 | percent($bandwidth{$toplisting[$i]},$total) ,"\]\n";
|
---|
| 35 | }
|
---|
| 36 | exit(0);
|
---|
Note:
See
TracBrowser
for help on using the repository browser.