Erik Zachte has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/72085


Change subject: disable last set of charts + minor tweaks in revert reporting
......................................................................

disable last set of charts + minor tweaks in revert reporting

Change-Id: I327c7e40809ec2bbb3ada92750288196443eacae
---
M dumps/perl/WikiReports.pl
M dumps/perl/WikiReportsOutputEditHistory.pm
M dumps/perl/WikiReportsProcessReverts.pm
M dumps/perl/WikiReportsScriptsR.pm
4 files changed, 36 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikistats 
refs/changes/85/72085/1

diff --git a/dumps/perl/WikiReports.pl b/dumps/perl/WikiReports.pl
index c879dda..26cc588 100644
--- a/dumps/perl/WikiReports.pl
+++ b/dumps/perl/WikiReports.pl
@@ -272,8 +272,6 @@
      &ReadEditHistory ;
      &ReadRevertHistoryGenerateReports ;
      &GenerateEditHistoryReports ; # wait till R runs on stat1
-# print "TEST !!! end\n" ; # qqq    
-# exit ;                   # qqq
   }
 
   if (($language eq "en") && (! $mode_wm))
diff --git a/dumps/perl/WikiReportsOutputEditHistory.pm 
b/dumps/perl/WikiReportsOutputEditHistory.pm
index dd9f0a2..aecc509 100644
--- a/dumps/perl/WikiReportsOutputEditHistory.pm
+++ b/dumps/perl/WikiReportsOutputEditHistory.pm
@@ -110,7 +110,7 @@
 #    &WriteEditsPerUserType ('fy') ;
 #    &GeneratePlotEdits     ('fy');
 #    &GeneratePlotReverts   ('fy') ;
-#    &GeneratePlotAnons     ('fy') ;
+#    &GeneratePlotAnons     ('fy') ; # disabled
 #    &GenerateEditHistoryReport ($plots_all, 4, 'Table') ;
 #    return ;
 #  }
@@ -126,7 +126,7 @@
     &WriteEditsPerUserType ($lang) ;
     &GeneratePlotEdits     ($lang) ;
     &GeneratePlotReverts   ($lang) ;
-    &GeneratePlotAnons     ($lang) ;
+  # &GeneratePlotAnons     ($lang) ; # disabled, R code needs debugging, and 
there is plenty to take in from other charts
 
     $plots_all ++ ;
     $plot_size = -s "$path_out_plots\/PlotEdits" . uc($lang) . ".png" ;
@@ -575,8 +575,6 @@
 
   my $file_script_R = $path_in . "R-PlotScriptEdits.R-in" ;
   &GeneratePlotCallR ($out_script_plot, $file_script_R) ;
-
-exit ; # qqq
 }
 
 sub GeneratePlotReverts
@@ -683,7 +681,7 @@
   $out_script_plot =~ s/LANGUAGE/$out_language_name/g ;
 
   $reverts_ylim = ceil ($reverts_perc_max/5) * 5 ;
-  $out_script_plot =~ s/YLIM/c(0,$reverts_ylim)/g ;
+  $out_script_plot =~ s/YLIM_MAX/c(0,$reverts_ylim)/g ;
 
   my $file_script_R = $path_in . "R-PlotScriptReverts.R-in" ;
   &GeneratePlotCallR ($out_script_plot, $file_script_R) ;
@@ -691,6 +689,8 @@
 
 sub GeneratePlotAnons
 {
+  return ; # skip for now, charts difficult to read, and R code needs debugging
+
   my $lang = shift ;
 
   return if $lang =~ /^zzz?$/ ;
@@ -786,7 +786,7 @@
 
   $out_script_plot =~ s/LANGUAGE/$out_language_name/g ;
 
-  $out_script_plot =~ s/YLIM/c(0,$reverts_ylim)/g ;
+  $out_script_plot =~ s/YLIM_MAX/c(0,$reverts_ylim)/g ;
 
   my $file_script_R = $path_in . "R-PlotScriptAnons.R-in" ;
   &GeneratePlotCallR ($out_script_plot, $file_script_R) ;
@@ -850,16 +850,18 @@
     $month2 = $months {$month} ;
     my ($mm,$dd,$yy) = split ('\/', $month2) ;
     my  $yyyymm = sprintf ("%04d%02d",$yy,$mm) ;
+
+    # needed to get equal number of rows in decomposed R object (which always 
starts with value for January)
     if ($months++ == 0)
     {
       if ($mm > 2)
       {
-        print EDITS_OUT "$lang," . sprintf ("%02d/%02d/%04d", 1,     31, $yy) 
. ",0,0,0,0\n" ;
-        print EDITS_OUT "$lang," . sprintf ("%02d/%02d/%04d", $mm-1, 28, $yy) 
. ",0,0,0,0\n" ;
+        print EDITS_OUT "$lang," . sprintf ("%02d/%02d/%04d", 1,     31, $yy) 
. ",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n" ;
+        print EDITS_OUT "$lang," . sprintf ("%02d/%02d/%04d", $mm-1, 28, $yy) 
. ",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n" ;
       }
       elsif ($mm == 2)
       {
-        print EDITS_OUT "$lang," . sprintf ("%02d/%02d/%04d", 1,     31, $yy) 
. ",0,0,0,0\n" ;
+        print EDITS_OUT "$lang," . sprintf ("%02d/%02d/%04d", 1,     31, $yy) 
. ",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n" ;
       }
     }
 
diff --git a/dumps/perl/WikiReportsProcessReverts.pm 
b/dumps/perl/WikiReportsProcessReverts.pm
index e5d6f06..5c4d113 100644
--- a/dumps/perl/WikiReportsProcessReverts.pm
+++ b/dumps/perl/WikiReportsProcessReverts.pm
@@ -26,8 +26,8 @@
   foreach $wp (@languages)
   {
     # next if $wp ne "en" ;
-next if $wp ne "fy" ; # qqq
-  &LogT ("\nReadRevertHistoryGenerateReports $wp\n\n") ;
+  
+    &LogT ("\nReadRevertHistoryGenerateReports $wp\n\n") ;
 
     undef %reverts_per_article ;
     undef %reverts_in_non_article_namespaces ;
@@ -236,7 +236,6 @@
 {
   my $wp = shift ;
   &Log ("ProcessRevertsStats $wp\n") ;
-return if $wp ne 'fy' ; # qqq
 
   undef @top_reverting_users ;
   undef @top_reverted_users ;
@@ -353,7 +352,7 @@
 {
   my $wp = shift ;
   &LogT ("WriteReportReverts $wp\n") ;
-return if $wp ne 'fy' ; # qqq
+
   &ReadFileCsv ($file_csv_namespaces) ;
   foreach $line (@csv)
   {
@@ -382,7 +381,9 @@
 
   my $out_html_title = $out_statistics . " \- " . "Edit and Revert Trends" ;
   my $out_page_title = $out_statistics . " \- " . "Edit and Revert Trends: " 
."<a href='" . $out_urls {$wp} . "'>" . $out_languages {$wp} . "</a>" ;
-  my $show_anons = ($editstottype {'A'}{$wp} > 100) ; # only on larger wikis # 
($wp =~ /(?:en|de|ja|fr|pl|es|pt|ru|zh|nl|af)/i) ;
+
+# my $show_anons = ($editstottype {'A'}{$wp} > 100) ; # only on larger wikis # 
($wp =~ /(?:en|de|ja|fr|pl|es|pt|ru|zh|nl|af)/i) ;
+  my $show_anons = $false ;
 
   if (defined ($dumpdate_hi))
   {
diff --git a/dumps/perl/WikiReportsScriptsR.pm 
b/dumps/perl/WikiReportsScriptsR.pm
index c3553fa..e78e458 100644
--- a/dumps/perl/WikiReportsScriptsR.pm
+++ b/dumps/perl/WikiReportsScriptsR.pm
@@ -193,6 +193,11 @@
 
 $include_script_credits_ez
 $include_script_plot_go
+__SCRIPT_EDIT_PLOT_EDITS__
+
+# PE = Plot Edits Trends (same script, second chart)
+
+$out_script_plot_edits .= <<__SCRIPT_EDIT_PLOT_EDITS_TRENDS__ ;
 
 plotdata <- read.csv(file="FILE_CSV",head=TRUE,sep=",")[2:22]
 counts   <- plotdata[2:6]
@@ -215,7 +220,7 @@
 plotdata
 attach (plotdata)
 
-$include_script_reverts_cairo
+$include_script_reverts_cairo_trends
 
 r <- as.POSIXct(round(range(dates), "days"))
 
@@ -246,7 +251,7 @@
 mtext("MAX_MONTH: EDITS ", cex=0.85, line=0.5, side=3, adj=0, outer=FALSE, 
col="#000000")
 $include_script_credits_ez
 $include_script_plot_go
-__SCRIPT_EDIT_PLOT_EDITS__
+__SCRIPT_EDIT_PLOT_EDITS_TRENDS__
 
 #----------------------------------------------------------
 
@@ -297,14 +302,18 @@
 
 $include_script_credits_ez
 $include_script_plot_go
+__SCRIPT_EDIT_PLOT_REVERTS__
+
+# PR = Plot Reverts Trends (same script, second chart)
+$out_script_plot_reverts .= <<__SCRIPT_EDIT_PLOT_REVERTS_TRENDS__ ;
 
 plotdata <- read.csv(file="FILE_CSV",head=TRUE,sep=",")[2:22]
 counts   <- plotdata[2:21]
 
 $include_script_dates
 
-times_tot = ts(plotdata\$PR_reverts_total,       start=2001, freq=12)
-times_reg = ts(plotdata\$PR_reverts_reg_users,   start=2001, freq=12)
+times_tot  = ts(plotdata\$PR_reverts_total,      start=2001, freq=12)
+times_reg  = ts(plotdata\$PR_reverts_reg_users,  start=2001, freq=12)
 times_anon = ts(plotdata\$PR_reverts_anon_users, start=2001, freq=12)
 times_bots = ts(plotdata\$PR_reverts_bots,       start=2001, freq=12)
 
@@ -347,7 +356,7 @@
 
 $include_script_credits_ez
 $include_script_plot_go
-__SCRIPT_EDIT_PLOT_REVERTS__
+__SCRIPT_EDIT_PLOT_REVERTS_TRENDS__
 
 
 #----------------------------------------------------------
@@ -388,6 +397,10 @@
 
 $include_script_credits_ez
 $include_script_plot_go
+__SCRIPT_EDIT_PLOT_ANONS__
+
+# PA = Plot Anons Trends (same script, second chart)
+$out_script_plot_anons .= <<__SCRIPT_EDIT_PLOT_ANONS_TRENDS__ ;
 
 plotdata  <- read.csv(file="FILE_CSV",head=TRUE,sep=",")[2:26]
 counts    <- plotdata[2:25]
@@ -438,9 +451,8 @@
 mtext("MAX_MONTH: EDITS ", cex=0.85, line=0.5, side=3, adj=0, outer=FALSE, 
col="#000000")
 
 $include_script_credits_ez
-
 $include_script_plot_go
-__SCRIPT_EDIT_PLOT_ANONS__
+__SCRIPT_EDIT_PLOT_ANONS_TRENDS__
 
 # PB = Plot Binaries
 $out_script_plot_binaries = <<__SCRIPT_EDIT_PLOT_BINARIES__ ;

-- 
To view, visit https://gerrit.wikimedia.org/r/72085
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I327c7e40809ec2bbb3ada92750288196443eacae
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats
Gerrit-Branch: master
Gerrit-Owner: Erik Zachte <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to