r96292 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96291‎ | r96292 | r96293 >
Date:17:38, 5 September 2011
Author:ezachte
Status:deferred
Tags:
Comment:
new data file written for edits for visualization
Modified paths:
  • /trunk/wikistats/squids/SquidCountArchiveReadInput.pm (modified) (history)

Diff [purge]

Index: trunk/wikistats/squids/SquidCountArchiveReadInput.pm
@@ -135,8 +135,20 @@
136136 print "Read log records in range $time_to_start till $time_to_stop\n\n" ;
137137
138138 if ($job_runs_on_production_server && $scan_all_fields)
139 - { open FILE_EDITS_SAVES, '>', "$path_out/$file_edits_saves" ; }
 139+ {
 140+ open FILE_EDITS_SAVES, '>', "$path_out/$file_edits_saves" ;
140141
 142+ my $file_csv_views_viz2 = $file_csv_views_viz ;
 143+ my $date = substr ($time_to_start,0,4) . substr ($time_to_start,5,2) . substr ($time_to_start,8,2) ;
 144+ $file_csv_views_viz2 =~ s/date/$date/ ;
 145+ $gz_csv_views_viz = gzopen ($file_csv_views_viz2, "wb") || die "Unable to write $file_csv_views_viz2 $!\n" ;
 146+
 147+ $comment = "# Data from $time_to_start till $time_to_stop (yyyy-mm-ddThh:mm:ss) - all counts in thousands due to sample rate of log (1 = 1000)\n" ;
 148+ $gz_csv_views_viz->gzwrite($comment) || die "Zlib error writing to $file_csv_views_viz: $gz_csv_views_viz->gzerror\n" ;
 149+ $comment = ":time,ip,domain,bot,mobile,os,client\n" ;
 150+ $gz_csv_views_viz->gzwrite($comment) || die "Zlib error writing to $file_csv_views_viz: $gz_csv_views_viz->gzerror\n" ;
 151+ }
 152+
141153 my $lines = 0 ;
142154 while ($#files > -1)
143155 {
@@ -241,7 +253,10 @@
242254 { return ($data_read) ; }
243255
244256 if ($job_runs_on_production_server)
245 - { close FILE_EDITS_SAVES ; }
 257+ {
 258+ close FILE_EDITS_SAVES ;
 259+ gzclose $gz_csv_views_viz ;
 260+ }
246261
247262 $lines_read {$date_prev} = $lines_this_day ;
248263
@@ -253,6 +268,17 @@
254269 else
255270 { print "$lines_this_day out $lines_in_file processed\n" ; }
256271
 272+ if ($url_wikipedia_mobile > 0)
 273+ {
 274+ print "\n$redirected_to_mobile out of $url_wikipedia_mobile (" . sprintf ("%.1f\%", 100 * $redirected_to_mobile / $url_wikipedia_mobile) . ") redirected to mobile wikipedia\n\n" ;
 275+ foreach $status (sort {$status_url_wikipedia_mobile {$b} <=> $status_url_wikipedia_mobile {$a}} keys %status_url_wikipedia_mobile)
 276+ { print "Status $status: " . $status_url_wikipedia_mobile {$status} . "\n" ; }
 277+ print "\n" ;
 278+ }
 279+
 280+ else
 281+ { print "\nNo mobile urls detected ?!?!\n\n" ; }
 282+
257283 return ($data_read) ;
258284 }
259285

Status & tagging log