Index: trunk/wikistats/squids/SquidCountArchiveReadInput.pm |
— | — | @@ -135,8 +135,20 @@ |
136 | 136 | print "Read log records in range $time_to_start till $time_to_stop\n\n" ; |
137 | 137 | |
138 | 138 | 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" ; |
140 | 141 | |
| 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 | + |
141 | 153 | my $lines = 0 ; |
142 | 154 | while ($#files > -1) |
143 | 155 | { |
— | — | @@ -241,7 +253,10 @@ |
242 | 254 | { return ($data_read) ; } |
243 | 255 | |
244 | 256 | if ($job_runs_on_production_server) |
245 | | - { close FILE_EDITS_SAVES ; } |
| 257 | + { |
| 258 | + close FILE_EDITS_SAVES ; |
| 259 | + gzclose $gz_csv_views_viz ; |
| 260 | + } |
246 | 261 | |
247 | 262 | $lines_read {$date_prev} = $lines_this_day ; |
248 | 263 | |
— | — | @@ -253,6 +268,17 @@ |
254 | 269 | else |
255 | 270 | { print "$lines_this_day out $lines_in_file processed\n" ; } |
256 | 271 | |
| 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 | + |
257 | 283 | return ($data_read) ; |
258 | 284 | } |
259 | 285 | |