Update total bandwidth estimate
authorTom Hughes <tom@compton.nu>
Wed, 21 Jan 2015 20:57:38 +0000 (20:57 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 21 Jan 2015 21:08:42 +0000 (21:08 +0000)
bin/sumlogs

index c46bcbaed4ede083dd458f36eb34258122d72a16..e342adc22ba4aede43b1fb3131428830b1923c00 100755 (executable)
@@ -7,6 +7,7 @@ use Geo::IP;
 use YAML;
 
 my $gi = Geo::IP->open("/usr/share/GeoIP/GeoIP.dat", GEOIP_MEMORY_CACHE);
+my $total_bandwidth = 560 * 1024 * 1024;
 my $total_bytes = 0;
 my %country_bytes;
 
@@ -45,7 +46,7 @@ my %country_bandwidth;
 
 while (my($country,$bytes) = each %country_bytes)
 {
-    $country_bandwidth{$country} = $bytes * 300 * 1024 * 1024 / $total_bytes;
+    $country_bandwidth{$country} = $bytes * $total_bandwidth / $total_bytes;
 }
 
 print Dump(\%country_bandwidth);