Index: trunk/wikistats/progress/WikiCountsJobProgress.pl |
— | — | @@ -124,7 +124,7 @@ |
125 | 125 | &ReadStatsCsv ("wv") ;
|
126 | 126 | &ReadStatsCsv ("wx") ;
|
127 | 127 |
|
128 | | - &ReadStatsHtml ($dir_html,"") ;
|
| 128 | + &ReadStatsHtml ($dir_html,"wikipedia") ;
|
129 | 129 | &ReadStatsHtml ($dir_html,"wikibooks") ;
|
130 | 130 | &ReadStatsHtml ($dir_html,"wiktionary") ;
|
131 | 131 | &ReadStatsHtml ($dir_html,"wikinews") ;
|
— | — | @@ -314,7 +314,11 @@ |
315 | 315 | my $dir = shift ;
|
316 | 316 | my $project = shift ;
|
317 | 317 |
|
318 | | - $dir = "$dir/$project" ;
|
| 318 | + if ($project ne "wikipedia")
|
| 319 | + { $dir = "$dir/$project" ; }
|
| 320 | +
|
| 321 | + my @languages ;
|
| 322 | +
|
319 | 323 | my $lastdir = getcwd();
|
320 | 324 | chdir ($dir) || die "Cannot chdir to $dir\n";
|
321 | 325 | local (*DIR);
|
— | — | @@ -330,24 +334,46 @@ |
331 | 335 | }
|
332 | 336 | closedir DIR;
|
333 | 337 |
|
| 338 | + $project2 = ucfirst ($project) ;
|
| 339 | +
|
| 340 | + $reports {$project} = "<p><b>$project2</b> <small>[count]</small> " ;
|
| 341 | + $reports_cnt = 0 ;
|
334 | 342 | foreach $language (sort @languages)
|
335 | 343 | {
|
336 | | - $file_age = int (-M "$dir/$language/index.html") ;
|
337 | | - $file_date = time - int (24*60*60*(-M "$dir/$language/index.html")) ;
|
338 | | - if ($language eq "EN")
|
339 | | - {
|
| 344 | + $language_lc = lc ($language) ;
|
| 345 | +
|
| 346 | + $file_age = -M "$dir/$language/index.html" ;
|
| 347 | + $file_age_days = int ($file_age) ;
|
| 348 | + $file_age_min = int (24*60 *$file_age) ;
|
| 349 | + $file_age_secs = int (24*60*60*$file_age) ;
|
| 350 | + $file_date = time - $file_age_secs ;
|
| 351 | + # if ($language eq "EN")
|
| 352 | + # {
|
340 | 353 | if ($project eq "")
|
341 | 354 | { $project = "wikipedia" ; }
|
342 | | - ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=gmtime($file_date);
|
343 | | - my $now_gm = sprintf ("%02d-%02d-%04d %02d:%02d\n",$mday,$mon+1,$year+1900,$hour,$min) ;
|
344 | | - ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime($file_date);
|
345 | | - my $now = sprintf ("%02d-%02d-%04d %02d:%02d\n",$mday,$mon+1,$year+1900,$hour,$min) ;
|
346 | | - $project2 = ucfirst ($project) ;
|
347 | | - $reports {$project} = "<tr><td><small>$project2</small></td><td><small>$now EST</small></td><td><small>=</small></td><td><small>$now_gm GMT</small></td></tr>" ;
|
348 | | - $report_dates {$project} = $file_date ;
|
349 | | - $reports_total ++ ;
|
350 | | - }
|
| 355 | +
|
| 356 | + ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime ($file_date);
|
| 357 | +
|
| 358 | + $file_ago = $file_age_days ;
|
| 359 | + if ($file_ago == 0)
|
| 360 | + { $file_ago = " <u>0 days, $file_age_min min</u>" ; }
|
| 361 | +
|
| 362 | + $color = "green" ;
|
| 363 | + if ($file_ago > 30)
|
| 364 | + { $color = "darkred" ; }
|
| 365 | + $reports {$project} .= "<small><font color=$color>$language_lc<sup>$file_ago</sup></font></small>, " ;
|
| 366 | + $reports_cnt ++ ;
|
| 367 | +
|
| 368 | + if ($language eq "EN")
|
| 369 | + {
|
| 370 | + $report_dates {$project} = $file_date ;
|
| 371 | + $reports_total ++ ;
|
| 372 | + }
|
| 373 | + # }
|
351 | 374 | }
|
| 375 | + $reports {$project} =~ s/, $// ;
|
| 376 | + $reports {$project} =~ s/count/$reports_cnt/ ;
|
| 377 | +
|
352 | 378 | chdir ($lastdir) ;
|
353 | 379 | }
|
354 | 380 |
|
— | — | @@ -504,13 +530,16 @@ |
505 | 531 | {
|
506 | 532 | print HTML "<a name='reports' id='reports'></a>" .
|
507 | 533 | "<hr><b>Reports generated</b>\n" .
|
508 | | - "<table>\n";
|
| 534 | + "<small>This section shows -per project per target language- the file age of index.html in days (for age < 24 hours in minutes). " .
|
| 535 | + "Note that a very recently generated report does not always contain counts up to the previous month. " .
|
| 536 | + "See above for how up to data counts are per project language. " .
|
| 537 | + "Color green here means: reports have been generated and published less than 30 days ago.</small>" ;
|
| 538 | +
|
| 539 | +
|
509 | 540 | foreach $report (sort {$report_dates {$b} <=> $report_dates {$a}} keys %report_dates)
|
510 | 541 | { print HTML $reports {$report} . "\n" ; }
|
511 | | - print HTML "</table>\n</small>\n" ;
|
512 | 542 | }
|
513 | 543 |
|
514 | | -
|
515 | 544 | print HTML "<hr><p><b>Longest jobs</b> <small>\n" ;
|
516 | 545 | $html = "<table border=1 spacing=0><tr><td valign=top><table>\n" ;
|
517 | 546 | $jobs = 0 ;
|
— | — | @@ -628,6 +657,9 @@ |
629 | 658 | "</style>\n" .
|
630 | 659 |
|
631 | 660 | "<body bgcolor=#CCCCCC>\n" ;
|
| 661 | + print HTML "<h3>Disclaimer</h3>\n" ;
|
| 662 | + print HTML "<small>This report offers a very concise overview of wikistats status for data collecting and reporting." .
|
| 663 | + "This is not an official WMF publication. It has been built by Erik Zachte primarily for personal use.</small>\n" ;
|
632 | 664 | print HTML "<h3>Cached files from <a href='http://dammit.lt/wikistats'>http://dammit.lt/wikistats</a></h3>\n" ;
|
633 | 665 | print HTML "<p><small><pre>\n" ;
|
634 | 666 | print HTML "../projectcounts: " . sprintf ("%4d", $files_projectcounts) . " files, newest file $file_new_projectcounts\n" ;
|
— | — | @@ -645,7 +677,11 @@ |
646 | 678 |
|
647 | 679 | print HTML "</pre></small>" ;
|
648 | 680 |
|
649 | | - print HTML "<hr><p><h3>Progress per project</h3>" ;
|
| 681 | + print HTML "<hr><p><h3>Progress per project, collecting data</h3>" .
|
| 682 | + "<small>This section shows -per project per wiki language- how many days ago data were collected and till when. " .
|
| 683 | + "Days ago is shown in superscript. For jobs which ran an hour or more this is followed by run time, and language code is shown in bold. " .
|
| 684 | + "The color signals up till which month data have been processed. Best is up till last month which is shown in green. See also <a href='#legend'>legend</a>.</small> " ;
|
| 685 | +
|
650 | 686 | $html = "" ;
|
651 | 687 | $project_prev = "" ;
|
652 | 688 | foreach $run (sort keys %runtimes2)
|
— | — | @@ -719,6 +755,19 @@ |
720 | 756 | { $project2 = "<u>$project2</u>" ; }
|
721 | 757 | print HTML "<p><b>$project2</b> <small>[$languages] $html</small>\n" ;
|
722 | 758 |
|
| 759 | + if ($reports_total > 0)
|
| 760 | + {
|
| 761 | + print HTML "<a name='reports' id='reports'></a>\n" .
|
| 762 | + "<hr><p><h3>Progress per project, reporting</h3>" .
|
| 763 | + "<small>This section shows -per project per target language- the file age of index.html in days (for age < 24 hours in minutes). " .
|
| 764 | + "Note that a very recently generated report does not always contain counts up to the previous month. " .
|
| 765 | + "See above for how up to data counts are per project language. " .
|
| 766 | + "Color green here means: reports have been generated and published less than 30 days ago.</small>" ;
|
| 767 | +
|
| 768 | + foreach $report (sort {$report_dates {$b} <=> $report_dates {$a}} keys %report_dates)
|
| 769 | + { print HTML $reports {$report} . "\n" ; }
|
| 770 | + }
|
| 771 | +
|
723 | 772 | print HTML "<hr>" ;
|
724 | 773 | &WriteHtmlJobRunTimes ;
|
725 | 774 |
|