Index: trunk/wikistats/squids/SquidReportArchive.pl |
— | — | @@ -9,9 +9,9 @@ |
10 | 10 | |
11 | 11 | # set defaults mainly for tests on local machine |
12 | 12 | # default_argv "-m 2011-07 " ; |
13 | | -# default_argv "-c -q 2010Q1" ; |
| 13 | + default_argv "-c -q 2011Q4" ; |
14 | 14 | # default_argv "-w" ; # refresh country info from Wikipedia (population etc) |
15 | | - default_argv "-c" ; |
| 15 | +# default_argv "-c" ; |
16 | 16 | |
17 | 17 | # to do: add text from http://wiki.squid-cache.org/SquidFaq/SquidLogs |
18 | 18 | # ReportOrigin how to handle '!error <-> other |
— | — | @@ -508,6 +508,8 @@ |
509 | 509 | "Absolute traffic counts for October 2011 are approximatly 7% too low.<br>" . |
510 | 510 | "Data loss only occurred during peak hours. It therefore may have had somewhat different impact for traffic from different parts of the world.<br>" . |
511 | 511 | "and may have also skewed relative figures like share of traffic per browser or operating system.</font><p>" ; |
| 512 | + $header .= "<font color=#900000>From mid September till late November squid log records for mobile traffic were in invalid format.<br>" . |
| 513 | + "Data could be repaired for logs from mid October onwards. Older logs were no longer available.<p>" ; |
512 | 514 | $header .= "<font color=#900000>In a an unrelated server outage precisely half of traffic to WMF mobile sites was not counted from Oct 16 - Nov 29 (one of two load-balanced servers did not report traffic).<br>" . |
513 | 515 | "WMF has since improved server monitoring, so that similar outages should be detected and fixed much faster from now on.</font><p>" ; |
514 | 516 | } |
— | — | @@ -1401,16 +1403,15 @@ |
1402 | 1404 | chomp $line ; |
1403 | 1405 | |
1404 | 1406 | $line =~ s/[\x00-\x1f]//g ; |
1405 | | - $line =~ s/C..?te d'Ivoire/Côte d'Ivoire/g ; |
1406 | 1407 | |
1407 | 1408 | ($country,$link,$population,$connected,$icon) = split ',', $line ; |
1408 | | - print "COUNTRY $country\nLINK $link\nPOPULATION $population\nCONNECTED $connected\n\n" ; |
| 1409 | + # print "COUNTRY $country\nLINK $link\nPOPULATION $population\nCONNECTED $connected\n\n" ; |
1409 | 1410 | $country =~ s/,/,/g ; |
1410 | 1411 | |
1411 | 1412 | # use country names as given by MaxMind |
1412 | 1413 | $country =~ s/Brunei/Brunei Darussalam/ ; |
1413 | | - $country =~ s/Congo, The Democratic Republic of the/Republic of the Congo/ ; |
1414 | | - $country =~ s/Dem. Rep. of Congo/Congo - The Democratic Republic of the/ ; |
| 1414 | + # $country =~ s/Congo, The Democratic Republic of the/Democratic Republic of the Congo/ ; |
| 1415 | + # $country =~ s/Dem. Rep. of Congo/Democratic Republic of the Congo/ ; |
1415 | 1416 | $country =~ s/East timor/Timor-Leste/ ; |
1416 | 1417 | $country =~ s/Guyane/French Guiana/ ; |
1417 | 1418 | $country =~ s/Iran/Iran, Islamic Republic of/ ; |
— | — | @@ -1418,17 +1419,20 @@ |
1419 | 1420 | $country =~ s/Libya/Libyan Arab Jamahiriya/ ; |
1420 | 1421 | $country =~ s/Macau/Macao/ ; |
1421 | 1422 | $country =~ s/Moldova/Moldova, Republic of/ ; |
1422 | | - $country =~ s/North Korea/Korea, Republic of/ ; |
| 1423 | + # $country =~ s/North Korea/Korea, Republic of/ ; |
1423 | 1424 | $country =~ s/Palestine/Palestinian Territory/ ; |
1424 | | - $country =~ s/Republic of the Congo/Congo/ ; |
| 1425 | + # $country =~ s/Republic of the Congo/Congo/ ; |
1425 | 1426 | $country =~ s/Russia/Russian Federation/ ; |
1426 | | - $country =~ s/North Korea/Korea, Democratic People's Republic of/ ; |
1427 | | - $country =~ s/South Korea/Korea, Republic of/ ; |
| 1427 | + # $country =~ s/North Korea/Korea, Democratic People's Republic of/ ; |
| 1428 | + # $country =~ s/South Korea/Korea, Republic of/ ; |
1428 | 1429 | $country =~ s/Syria/Syrian Arab Republic/ ; |
1429 | 1430 | $country =~ s/Tanzania/Tanzania, United Republic of/ ; |
1430 | 1431 | $country =~ s/U.S. Virgin Islands/Virgin Islands, British/ ; |
1431 | 1432 | $country =~ s/Vatican City/Holy See (Vatican City State)/ ; |
1432 | | - $country =~ s/^Korea$/South Korea/ ; |
| 1433 | + # $country =~ s/^Korea$/South Korea/ ; |
| 1434 | + |
| 1435 | + if ($connected eq 'connected') |
| 1436 | + { &Log ("connected unknown: $country\n") ; } |
1433 | 1437 | $connected =~ s/connected/../g ; |
1434 | 1438 | $country_meta_info {$country} = "$link,$population,$connected,$icon" ; |
1435 | 1439 | |
— | — | @@ -4767,12 +4771,12 @@ |
4768 | 4772 | # now use country names that are suitable for http://gunn.co.nz/map/ |
4769 | 4773 | $country2 = $country ; |
4770 | 4774 | $country2 =~ s/Moldova, Republic of/Moldova/ ; |
4771 | | - $country2 =~ s/Korea, Republic of/South Korea/ ; |
4772 | | - $country2 =~ s/Korea, Democratic People's Republic of/North Korea/ ; |
| 4775 | + # $country2 =~ s/Korea, Republic of/South Korea/ ; |
| 4776 | + # $country2 =~ s/Korea, Democratic People's Republic of/North Korea/ ; |
4773 | 4777 | $country2 =~ s/Iran, Islamic Republic of/Iran/ ; |
4774 | 4778 | $country2 =~ s/UAE/United Arab Emirates/ ; |
4775 | 4779 | $country2 =~ s/Congo - The Democratic Republic of the/Democratic Republic of the Congo/ ; |
4776 | | - $country2 =~ s/^Congo$/Republic of the Congo/ ; |
| 4780 | + # $country2 =~ s/^Congo$/Republic of the Congo/ ; |
4777 | 4781 | $country2 =~ s/Syrian Arab Republic/Syria/ ; |
4778 | 4782 | $country2 =~ s/Tanzania, United Republic of/Tanzania/ ; |
4779 | 4783 | $country2 =~ s/Libyan Arab Jamahiriya/Libya/ ; |
— | — | @@ -5091,7 +5095,7 @@ |
5092 | 5096 | $country =~ s/Iran, Islamic Republic of/Iran/ ; |
5093 | 5097 | $country =~ s/UAE/United Arab Emirates/ ; |
5094 | 5098 | $country =~ s/Congo - The Democratic Republic of the/Democratic Republic of the Congo/ ; |
5095 | | - $country =~ s/^Congo$/Republic of the Congo/ ; |
| 5099 | + # $country =~ s/^Congo$/Republic of the Congo/ ; |
5096 | 5100 | $country =~ s/Syrian Arab Republic/Syria/ ; |
5097 | 5101 | $country =~ s/Tanzania, United Republic of/Tanzania/ ; |
5098 | 5102 | $country =~ s/Libyan Arab Jamahiriya/Libya/ ; |
— | — | @@ -6173,7 +6177,21 @@ |
6174 | 6178 | $link =~ s/,/,/g ; |
6175 | 6179 | $icon =~ s/,/,/g ; |
6176 | 6180 | |
6177 | | - print "country: $country\nlink: $link\npopulation: $population\nconnected: $connected\nicon: $icon\n\n" ; |
| 6181 | + $country =~ s/Bosnia-Herzegovina/Bosnia and Herzegovina/ ; |
| 6182 | + $country =~ s/C.*.+te d'Ivoire/Cote d'Ivoire/ ; |
| 6183 | + $country =~ s/Macao/Macau/ ; # will be changed back later |
| 6184 | + $country =~ s/Samoa/American Samoa/ ; |
| 6185 | + $country =~ s/Timor Leste/Timor-Leste/ ; |
| 6186 | + $country =~ s/UAE/United Arab Emirates/ ; |
| 6187 | + $country =~ s/Korea, South/South Korea/ ; |
| 6188 | + $country =~ s/Congo, Democratic Republic of/Democratic Republic of the Congo/ ; |
| 6189 | + $country =~ s/Congo, Republic of/Republic of the Congo/ ; |
| 6190 | + $country =~ s/Macedonia, Republic of/Republic of Macedonia/ ; |
| 6191 | + $country =~ s/Gambia, The/Gambia/ ; |
| 6192 | + $country =~ s/Bahamas, The/The Bahamas/ ; |
| 6193 | + $country =~ s/,/,/g ; |
| 6194 | + |
| 6195 | + # print "country: $country\nlink: $link\npopulation: $population\nconnected: $connected\nicon: $icon\n\n" ; |
6178 | 6196 | $countries {$country} = "$country,$link,$population,connected,$icon\n" ; |
6179 | 6197 | } |
6180 | 6198 | |
— | — | @@ -6210,17 +6228,33 @@ |
6211 | 6229 | |
6212 | 6230 | $country =~ s/,/,/g ; |
6213 | 6231 | $country =~ s/Bosnia-Herzegovina/Bosnia and Herzegovina/ ; |
6214 | | - $country =~ s/Cote d'Ivoire/Côte d'Ivoire/ ; |
| 6232 | + $country =~ s/C.*.+te d'Ivoire/Cote d'Ivoire/ ; |
6215 | 6233 | $country =~ s/Macao/Macau/ ; # will be changed back later |
6216 | 6234 | $country =~ s/Samoa/American Samoa/ ; |
6217 | 6235 | $country =~ s/Timor Leste/Timor-Leste/ ; |
6218 | 6236 | $country =~ s/UAE/United Arab Emirates/ ; |
| 6237 | + $country =~ s/Korea, South/South Korea/ ; |
| 6238 | + $country =~ s/Congo, Democratic Republic of/Democratic Republic of the Congo/ ; |
| 6239 | + $country =~ s/Congo, Republic of/Republic of the Congo/ ; |
| 6240 | + $country =~ s/Macedonia, Republic of/Republic of Macedonia/ ; |
| 6241 | + $country =~ s/Gambia, The/Gambia/ ; |
| 6242 | + $country =~ s/Bahamas, The/The Bahamas/ ; |
| 6243 | + $country =~ s/,/,/g ; |
6219 | 6244 | |
6220 | 6245 | print "country: $country\nconnected: $connected\n\n" ; |
6221 | 6246 | $countries {$country} =~ s/connected/$connected/ ; |
6222 | 6247 | } |
6223 | 6248 | |
6224 | | - print "Write $path_in/$file_csv_country_meta_info\n\n" ; # use $path_in, not $path_out so that next step picks up proper file |
| 6249 | + &Log ("Metric 'connected' unknown for:\n\n") ; |
| 6250 | + foreach $country (sort keys %countries) |
| 6251 | + { |
| 6252 | + $data = $countries {$country} ; |
| 6253 | + |
| 6254 | + if ($data =~ /connected/) |
| 6255 | + { &Log ("$country\n") ; } |
| 6256 | + } |
| 6257 | + |
| 6258 | + &Log ("Write $path_in/$file_csv_country_meta_info\n\n") ; # use $path_in, not $path_out so that next step picks up proper file |
6225 | 6259 | open COUNTRY_META_INFO, '>', "$path_in/$file_csv_country_meta_info" ; |
6226 | 6260 | foreach $country (sort keys %countries) |
6227 | 6261 | { print COUNTRY_META_INFO $countries {$country} ; } |