Index: trunk/wikistats/squids/SquidCountArchiveProcessLogRecord.pm |
— | — | @@ -24,6 +24,7 @@ |
25 | 25 | return ; |
26 | 26 | } |
27 | 27 | |
| 28 | + |
28 | 29 | # remember for each squid per hour lowest and highest sequence number and number of events |
29 | 30 | # later calc per hour average distance between events = (higest - lowest sequence number) / events - 1 |
30 | 31 | # distance between consecutive events that lay in different hour bin are ignored, begligible |
— | — | @@ -50,6 +51,18 @@ |
51 | 52 | $method = $fields [7] ; |
52 | 53 | $url = lc ($fields [8]) ; |
53 | 54 | |
| 55 | + if ($url =~ /\.m\.wikipedia.org/) |
| 56 | + { |
| 57 | + $url_wikipedia_mobile ++ ; |
| 58 | + $status_url_wikipedia_mobile {$status} ++ ; |
| 59 | + $status_mime_url_wikipedia_mobile {"$status,$mime"} ++ ; |
| 60 | + if ($status eq "TCP_MISS/302") |
| 61 | + { |
| 62 | + $redirected_to_mobile ++ ; |
| 63 | + return ; |
| 64 | + } |
| 65 | + } |
| 66 | + |
54 | 67 | $referer = lc ($fields [11]) ; |
55 | 68 | $agent = $fields [13] ; |
56 | 69 | |
— | — | @@ -531,7 +544,7 @@ |
532 | 545 | if ($os =~ /playstation/io) |
533 | 546 | { $version = "NetFront (PlayStation)" ; } |
534 | 547 | |
535 | | - $clients {"$mobile,$version"}++ ; |
| 548 | + $clients {"$mobile,$version,$mimecat"}++ ; |
536 | 549 | |
537 | 550 | $operating_systems =~ s/,/,/go ; |
538 | 551 | $operating_systems {"$mobile,$os"} ++ ; |
— | — | @@ -637,10 +650,17 @@ |
638 | 651 | |
639 | 652 | $clients_by_wiki {"$mobile,$version,$domain"}++ ; |
640 | 653 | |
| 654 | + # different output use either 'bot=N' or 'M'(anual) / 'bot=Y' or 'B'(ot) |
641 | 655 | if ($bot) |
642 | | - { $ind_bot = 'bot=Y' ; } |
| 656 | + { |
| 657 | + $ind_bot = 'bot=Y' ; |
| 658 | + $ind_bot2 = 'B' ; |
| 659 | + } |
643 | 660 | else |
644 | | - { $ind_bot = 'bot=N' ; } |
| 661 | + { |
| 662 | + $ind_bot = 'bot=N' ; |
| 663 | + $ind_bot2 = 'M' ; |
| 664 | + } |
645 | 665 | |
646 | 666 | if (($domain =~ /^\@/) || ($domain =~ /^\*/)) |
647 | 667 | { |
— | — | @@ -686,6 +706,11 @@ |
687 | 707 | $time_tt = $time_hh * 60 + $time_mm ; |
688 | 708 | $time_tt2 = $time_tt - $time_tt % 15 ; |
689 | 709 | $countries_timed {"$ind_bot,$domain,$country,$time_tt2"} ++ ; |
| 710 | + |
| 711 | + |
| 712 | + $time2 = substr ($time,0,19) ; # omit msec |
| 713 | + $line = "$time2,$client_ip,$domain,$ind_bot2,$mobile,$os,$version,$mimecat\n" ; |
| 714 | + $gz_csv_views_viz->gzwrite($line) || die "Zlib error writing to $file_csv_views_viz: $gz_csv_views_viz->gzerror\n" ; |
690 | 715 | } |
691 | 716 | } |
692 | 717 | |