r96291 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96290‎ | r96291 | r96292 >
Date:17:37, 5 September 2011
Author:ezachte
Status:deferred
Tags:
Comment:
browser breakdown now also per mime group + new csv file for page views for visualization
Modified paths:
  • /trunk/wikistats/squids/SquidCountArchiveProcessLogRecord.pm (modified) (history)

Diff [purge]

Index: trunk/wikistats/squids/SquidCountArchiveProcessLogRecord.pm
@@ -24,6 +24,7 @@
2525 return ;
2626 }
2727
 28+
2829 # remember for each squid per hour lowest and highest sequence number and number of events
2930 # later calc per hour average distance between events = (higest - lowest sequence number) / events - 1
3031 # distance between consecutive events that lay in different hour bin are ignored, begligible
@@ -50,6 +51,18 @@
5152 $method = $fields [7] ;
5253 $url = lc ($fields [8]) ;
5354
 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+
5467 $referer = lc ($fields [11]) ;
5568 $agent = $fields [13] ;
5669
@@ -531,7 +544,7 @@
532545 if ($os =~ /playstation/io)
533546 { $version = "NetFront (PlayStation)" ; }
534547
535 - $clients {"$mobile,$version"}++ ;
 548+ $clients {"$mobile,$version,$mimecat"}++ ;
536549
537550 $operating_systems =~ s/,/,/go ;
538551 $operating_systems {"$mobile,$os"} ++ ;
@@ -637,10 +650,17 @@
638651
639652 $clients_by_wiki {"$mobile,$version,$domain"}++ ;
640653
 654+ # different output use either 'bot=N' or 'M'(anual) / 'bot=Y' or 'B'(ot)
641655 if ($bot)
642 - { $ind_bot = 'bot=Y' ; }
 656+ {
 657+ $ind_bot = 'bot=Y' ;
 658+ $ind_bot2 = 'B' ;
 659+ }
643660 else
644 - { $ind_bot = 'bot=N' ; }
 661+ {
 662+ $ind_bot = 'bot=N' ;
 663+ $ind_bot2 = 'M' ;
 664+ }
645665
646666 if (($domain =~ /^\@/) || ($domain =~ /^\*/))
647667 {
@@ -686,6 +706,11 @@
687707 $time_tt = $time_hh * 60 + $time_mm ;
688708 $time_tt2 = $time_tt - $time_tt % 15 ;
689709 $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" ;
690715 }
691716 }
692717

Status & tagging log