Index: trunk/wikistats/squids/SquidCountArchiveProcessLogRecord.pm |
— | — | @@ -290,7 +290,7 @@ |
291 | 291 | |
292 | 292 | $os = ".." ; |
293 | 293 | |
294 | | - if ($agent2 =~ /CFNetwork/io) { $os = "iOS/OS X" } |
| 294 | + if ($agent2 =~ /CFNetwork/io) { $os = "iOS/OS X" } |
295 | 295 | elsif ($agent2 =~ /BlackBerry/io) {($os = $agent2) =~ s/^.*?BlackBerry[^\/]*\/(\d+\.\d+).*$/BlackBerry\/$1/io ; } # BlackBerry/8320/4.2 -> BlackBerry/4.2 |
296 | 296 | elsif ($agent2 =~ /DoCoMo/io) { $os = "DoCoMo" ; } |
297 | 297 | elsif ($agent2 =~ /iPad/io) { $version = "iPad" ; ($os = $agent2) =~ s/^.*?(iPad OS \d+\_\d+).*$/$1/io ; } |
— | — | @@ -346,7 +346,7 @@ |
347 | 347 | if (($os eq '..') && ($mobile eq 'M' || $mobile eq 'W')) |
348 | 348 | { |
349 | 349 | $os = "Mobile other" ; |
350 | | - $mobile_other {$agent2} += $count_event ; |
| 350 | + $mobile_other {$agent2} += $count_event ; |
351 | 351 | } |
352 | 352 | |
353 | 353 | if ($version =~ /(?:iPod|iPhone)/io) |
— | — | @@ -410,9 +410,9 @@ |
411 | 411 | |
412 | 412 | # iOS APPLICATIONS |
413 | 413 | elsif ($agent2 =~ /CFNetwork/io) |
414 | | - { |
| 414 | + { |
415 | 415 | $agent2 =~ s/^(.*) CFNetwork.*$/iOS: $1/io ; |
416 | | - if ($agent2 =~ /Wikipedia Mobile\//io) { $agent2 =~ s/$/ (WMF)/io ; } |
| 416 | + if ($agent2 =~ /Wikipedia Mobile\//io) { $agent2 =~ s/$/ (WMF)/io ; } |
417 | 417 | $version = $agent2 ; |
418 | 418 | } |
419 | 419 | |
— | — | @@ -476,7 +476,7 @@ |
477 | 477 | |
478 | 478 | # CHROME MOBILE |
479 | 479 | elsif ($agent2 =~ /CrMo\/\d+/io) |
480 | | - { ($version = $agent2) =~ s/^.*?(CrMo\/\d+\.\d+).*$/$1/o ; |
| 480 | + { ($version = $agent2) =~ s/^.*?(CrMo\/\d+\.\d+).*$/$1/o ; |
481 | 481 | $version =~ s/CrMo/ChromeMobile/o ; |
482 | 482 | } |
483 | 483 | |
— | — | @@ -610,7 +610,8 @@ |
611 | 611 | $clients {"$mobile,$version,$mimecat"} += $count_event ; ; |
612 | 612 | |
613 | 613 | $operating_systems =~ s/,/,/go ; |
614 | | - $operating_systems {"$mobile,$os"} += $count_event ; ; |
| 614 | + ($mobile2 = $mobile) =~ s/W/M/; # code 'W' was introduced for SquidReportClients only |
| 615 | + $operating_systems {"$mobile2,$os"} += $count_event ; ; |
615 | 616 | } |
616 | 617 | |
617 | 618 | if ($count_hits_per_ip_range) |
— | — | @@ -669,7 +670,7 @@ |
670 | 671 | if ($url =~ /api\.php?.*action=/io) |
671 | 672 | { |
672 | 673 | $api = $parm ; |
673 | | - $api =~ s/^.*action=([^\&]*)(\&.*)?$/$1/io ; |
| 674 | + $api =~ s/^.*action=([^\&]*)(\&.*)?$/$1/io ; |
674 | 675 | } |
675 | 676 | |
676 | 677 | #create useragents |
— | — | @@ -799,14 +800,16 @@ |
800 | 801 | if (! $test) |
801 | 802 | { |
802 | 803 | $time2 = substr ($time,0,19) ; # omit msec |
803 | | - $line = "$time2,$client_ip,$domain,$ind_bot2,$mobile,$os,$version,$mimecat\n" ; |
| 804 | + ($mobile2 = $mobile) =~ s/W/M/; # code 'W' was introduced for SquidReportClients only |
| 805 | + $line = "$time2,$client_ip,$domain,$ind_bot2,$mobile2,$os,$version,$mimecat\n" ; |
804 | 806 | $gz_csv_views_viz->gzwrite($line) || die "Zlib error writing to $file_csv_views_viz: $gz_csv_views_viz->gzerror\n" ; |
805 | 807 | } |
806 | 808 | } |
807 | 809 | |
808 | | - $records {"$mobile,$mimecat"} += $count_event ; |
| 810 | + ($mobile2 = $mobile) =~ s/W/M/; # code 'W' was introduced for SquidReportClients only |
| 811 | + $records {"$mobile2,$mimecat"} += $count_event ; |
809 | 812 | $records {"*,$mimecat"} += $count_event ; |
810 | | - $records {"$mobile,*"} += $count_event ; |
| 813 | + $records {"$mobile2,*"} += $count_event ; |
811 | 814 | $records {"*,*"} += $count_event ; |
812 | 815 | } |
813 | 816 | |
Index: trunk/wikistats/squids/SquidReportArchive.pl |
— | — | @@ -1853,7 +1853,7 @@ |
1854 | 1854 | { $site = 'W' ; } |
1855 | 1855 | else |
1856 | 1856 | { $site = 'X' ; } |
1857 | | - |
| 1857 | + |
1858 | 1858 | $countua {$agent, '.', '.', '.'} += $count ; |
1859 | 1859 | $countua {$agent, '.', '.', $api} += $count ; |
1860 | 1860 | $countua {$agent, $site, $page, '.'} += $count ; |
— | — | @@ -2916,7 +2916,7 @@ |
2917 | 2917 | { $mimetype2 .= "<br><small>(img)</small> " ; } |
2918 | 2918 | if ($columns == 1) |
2919 | 2919 | { $mimetype2 = "<font color=#008000>$mimetype2</font>" ; } |
2920 | | - if (($columns >= 2) && ($columns <= 4)) |
| 2920 | + elsif (($columns >= 2) && ($columns <= 4)) |
2921 | 2921 | { $mimetype2 = "<font color=#900000>$mimetype2</font>" ; } |
2922 | 2922 | ($mime1,$mime2) = split ('\/', $mimetype2, 2) ; |
2923 | 2923 | $header2 .= "<th class=c>$mime1<br>$mime2</th>\n" ; |
— | — | @@ -3014,7 +3014,7 @@ |
3015 | 3015 | $count = &FormatCount ($counts_pm {"$project,$mimetype"}) ; |
3016 | 3016 | if ($columns == 1) |
3017 | 3017 | { $html .= &ShowCountTd ($count,"#008000") ; } |
3018 | | - if (($columns >= 2) && ($columns <= 4)) |
| 3018 | + elsif (($columns >= 2) && ($columns <= 4)) |
3019 | 3019 | { $html .= &ShowCountTd ($count,"#900000") ; } |
3020 | 3020 | else |
3021 | 3021 | { $html .= &ShowCountTd ($count) . "\n" ; } |
— | — | @@ -4461,7 +4461,7 @@ |
4462 | 4462 | |
4463 | 4463 | my $total_count = $countua {'T', '.', '.', '.'} ; |
4464 | 4464 | my $total_html = $countua {'T', '.', 'page', '.'} ; |
4465 | | - my $api_multiplier = $countua {'S', '.', 'page', '.'} / $countua {'S', '.', '.', 'opensearch' } ; |
| 4465 | + my $api_multiplier = $countua {'S', '.', 'page', '.'} / $countua {'S', '.', '.', 'opensearch' } ; |
4466 | 4466 | |
4467 | 4467 | $mobile_browsers_all = &ShowCount ($countua {'M', '.', '.', '.'}, $marker_color) ; |
4468 | 4468 | $mobile_browsers_all_mobile = &ShowCount ($countua {'M', 'M', '.', '.'}) ; |
— | — | @@ -6202,7 +6202,7 @@ |
6203 | 6203 | { |
6204 | 6204 | my ($num,$color) = @_ ; |
6205 | 6205 | |
6206 | | - return ("<td class=r>" . &ShowCount ($num) . "</td>") ; |
| 6206 | + return ("<td class=r>" . &ShowCount ($num,$color) . "</td>") ; |
6207 | 6207 | } |
6208 | 6208 | |
6209 | 6209 | sub ShowCountTh |