source: liacs/ccs/op3/bandwidth.pl@ 4

Last change on this file since 4 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
Line 
1#!/usr/bin/env perl
2do "common.pl";
3
4%bandwidth;
5
6open(FILE,$file);
7while(<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}
15close(FILE);
16
17$total;
18@tmp;
19@toplisting;
20
21foreach $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
30print "Total Bandwidth (bytes): $total\n";
31print "top 10 bandwidth\n";
32foreach $i (0 .. 9 ) {
33 print $i + 1, ": $toplisting[$i] \[$bandwidth{$toplisting[$i]} ",
34 percent($bandwidth{$toplisting[$i]},$total) ,"\]\n";
35}
36exit(0);
Note: See TracBrowser for help on using the repository browser.