r109175 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109174‎ | r109175 | r109176 >
Date:18:33, 17 January 2012
Author:ezachte
Status:deferred
Tags:
Comment:
for historic reference + as example code: one time patch job
Modified paths:
  • /trunk/wikistats/dammit.lt/!DammitPatchProjectcountsForMobileServerDownOctNov.pl (added) (history)

Diff [purge]

Index: trunk/wikistats/dammit.lt/!DammitPatchProjectcountsForMobileServerDownOctNov.pl
@@ -0,0 +1,155 @@
 2+#!/usr/bin/perl
 3+
 4+$| = 1; # flush screen output
 5+
 6+chdir ("DammitPatchProjectcountsForServerOverload2011OctNovMobile/after") || die "Cannot chdir to DammitPatchProjectcountsForServerOverload2011OctNovMobile/after\n" ;
 7+
 8+# Asher
 9+# For October, cp1043 stopped logging on 10/15 at 23:24:23, so it wasn't counted for a tad >50% of the month.
 10+# For November, cp1043 was logging for 35 hours, or was missing around 95% of the month.
 11+# Actually figures rise again in 20111129-200000 (29 hours from end of month)
 12+# patch range 20111016-000000 - 20111129-200000: mobile stats * 2
 13+
 14+ @files = <*>;
 15+ foreach $file (@files)
 16+ {
 17+ next if ! -e $file ;
 18+ next if $file !~ /^projectcounts-\d{8}-\d{6}$/ ;
 19+ &Patch ($file) ;
 20+ }
 21+
 22+print "\n\nReady\n\n" ;
 23+exit ;
 24+
 25+sub Patch
 26+{
 27+ my ($file) = @_ ;
 28+
 29+ print "Patch file $file\n" ;
 30+ print LOG "Patch file $file\n" ;
 31+
 32+ open PROJECTFILE, '<', $file || die "Could not open '$file'\n" ;
 33+
 34+ undef @projectfile ;
 35+ while ($line = <PROJECTFILE>)
 36+ {
 37+ chomp $line ;
 38+ ($project,$dash,$count,$bytes) = split (' ', $line) ;
 39+
 40+ if ($project =~ /\.mw/)
 41+ {
 42+ $count *= 2 ;
 43+ $bytes *= 2 ;
 44+ $line = "$project $dash $count $bytes" ;
 45+ }
 46+ push @projectfile, "$line\n" ;
 47+ }
 48+
 49+ close PROJECTFILE ;
 50+
 51+
 52+ open PROJECTFILE, '>', $file || die "Could not open '$file'\n" ;
 53+ print PROJECTFILE @projectfile ;
 54+ close PROJECTFILE ;
 55+}
 56+
 57+# before this patch:
 58+# (records with bytes sent = 1 were already patched for server overload, this patch is cumulative)
 59+
 60+#projectcounts-20111015-000000:en.mw - 1118333 20883413293
 61+#projectcounts-20111015-010000:en.mw - 1153653 1
 62+#projectcounts-20111015-020000:en.mw - 1235714 1
 63+#projectcounts-20111015-030000:en.mw - 1277073 1
 64+#projectcounts-20111015-040000:en.mw - 1255903 1
 65+#projectcounts-20111015-050000:en.mw - 1114711 20581295139
 66+#projectcounts-20111015-060000:en.mw - 971278 17586940145
 67+#projectcounts-20111015-070000:en.mw - 840539 15153901986
 68+#projectcounts-20111015-080001:en.mw - 758891 13668939122
 69+#projectcounts-20111015-090000:en.mw - 712797 12765642068
 70+#projectcounts-20111015-100000:en.mw - 668190 1
 71+#projectcounts-20111015-110000:en.mw - 660336 11974415378
 72+#projectcounts-20111015-120000:en.mw - 724907 1
 73+#projectcounts-20111015-130000:en.mw - 809809 15129177894
 74+#projectcounts-20111015-140000:en.mw - 925587 17153050656
 75+#projectcounts-20111015-150000:en.mw - 1305923 1
 76+#projectcounts-20111015-160000:en.mw - 1094837 1
 77+#projectcounts-20111015-170000:en.mw - 1222474 1
 78+#projectcounts-20111015-180001:en.mw - 1020931 18588682396
 79+#projectcounts-20111015-190000:en.mw - 1330412 1
 80+#projectcounts-20111015-200000:en.mw - 1343696 1
 81+#projectcounts-20111015-210000:en.mw - 1384105 1
 82+#projectcounts-20111015-220000:en.mw - 1374371 1
 83+#projectcounts-20111015-230000:en.mw - 1299587 1
 84+#projectcounts-20111016-000000:en.mw - 885108 1
 85+#projectcounts-20111016-010000:en.mw - 649719 1
 86+#projectcounts-20111016-020000:en.mw - 677924 1
 87+#projectcounts-20111016-030000:en.mw - 719230 1
 88+#projectcounts-20111016-040001:en.mw - 651389 12344532099
 89+#projectcounts-20111016-050000:en.mw - 637134 1
 90+#projectcounts-20111016-060000:en.mw - 571744 1
 91+#projectcounts-20111016-070000:en.mw - 516809 1
 92+#projectcounts-20111016-080000:en.mw - 440191 1
 93+#projectcounts-20111016-090000:en.mw - 410063 1
 94+#projectcounts-20111016-100000:en.mw - 380565 1
 95+#projectcounts-20111016-110000:en.mw - 369823 1
 96+#projectcounts-20111016-120000:en.mw - 386359 1
 97+#projectcounts-20111016-130000:en.mw - 429909 1
 98+#projectcounts-20111016-140000:en.mw - 493544 1
 99+#projectcounts-20111016-150001:en.mw - 368162 6839158094
 100+#projectcounts-20111016-160000:en.mw - 405009 1
 101+#projectcounts-20111016-170000:en.mw - 464366 1
 102+#projectcounts-20111016-180000:en.mw - 496096 1
 103+#projectcounts-20111016-190000:en.mw - 466511 1
 104+#projectcounts-20111016-200000:en.mw - 491923 1
 105+#projectcounts-20111016-210000:en.mw - 619640 1
 106+#projectcounts-20111016-220000:en.mw - 790755 1
 107+#projectcounts-20111016-230000:en.mw - 773944 14908567555
 108+#projectcounts-20111129-000000:en.mw - 658202 12963090181
 109+#projectcounts-20111129-010000:en.mw - 663817 13152898167
 110+#projectcounts-20111129-020000:en.mw - 711947 14058285981
 111+#projectcounts-20111129-030000:en.mw - 803127 16551028434
 112+#projectcounts-20111129-040000:en.mw - 799227 16050235809
 113+#projectcounts-20111129-050000:en.mw - 746361 14902470928
 114+#projectcounts-20111129-060000:en.mw - 624624 12117890156
 115+#projectcounts-20111129-070000:en.mw - 521375 9862760692
 116+#projectcounts-20111129-080000:en.mw - 441473 8323325077
 117+#projectcounts-20111129-090001:en.mw - 379646 7126963252
 118+#projectcounts-20111129-100000:en.mw - 339564 6339545174
 119+#projectcounts-20111129-110000:en.mw - 324300 6080216942
 120+#projectcounts-20111129-120000:en.mw - 334918 6286356570
 121+#projectcounts-20111129-130000:en.mw - 370602 6970996093
 122+#projectcounts-20111129-140000:en.mw - 401666 7560271772
 123+#projectcounts-20111129-150000:en.mw - 420291 7889228670
 124+#projectcounts-20111129-160000:en.mw - 466071 8771078927
 125+#projectcounts-20111129-170000:en.mw - 465044 8786923839
 126+#projectcounts-20111129-180000:en.mw - 460876 8807419664
 127+#projectcounts-20111129-190000:en.mw - 536584 10232880511
 128+#projectcounts-20111129-200000:en.mw - 766271 14638516623
 129+#projectcounts-20111129-210001:en.mw - 1135531 21930878519
 130+#projectcounts-20111129-220000:en.mw - 1301065 25059905220
 131+#projectcounts-20111129-230000:en.mw - 1340507 25822559729
 132+#projectcounts-20111130-000000:en.mw - 1330214 25918201051
 133+#projectcounts-20111130-010000:en.mw - 1364502 26513997839
 134+#projectcounts-20111130-020000:en.mw - 1448165 28857827009
 135+#projectcounts-20111130-030000:en.mw - 1517979 29939164418
 136+#projectcounts-20111130-040000:en.mw - 1634592 32208418808
 137+#projectcounts-20111130-050000:en.mw - 1495205 29165795286
 138+#projectcounts-20111130-060000:en.mw - 1263647 24310380494
 139+#projectcounts-20111130-070000:en.mw - 1062462 20309814130
 140+#projectcounts-20111130-080001:en.mw - 886558 16882782806
 141+#projectcounts-20111130-090000:en.mw - 761288 14436310033
 142+#projectcounts-20111130-100000:en.mw - 684702 12872911393
 143+#projectcounts-20111130-110000:en.mw - 655848 12370104095
 144+#projectcounts-20111130-120000:en.mw - 686010 13107748725
 145+#projectcounts-20111130-130000:en.mw - 784738 14662045771
 146+#projectcounts-20111130-140000:en.mw - 873031 16315042117
 147+#projectcounts-20111130-150000:en.mw - 875939 16646388651
 148+#projectcounts-20111130-160000:en.mw - 800983 15222836300
 149+#projectcounts-20111130-170000:en.mw - 784713 14913634953
 150+#projectcounts-20111130-180000:en.mw - 1031183 19879047403
 151+#projectcounts-20111130-190000:en.mw - 909035 17613714868
 152+#projectcounts-20111130-200001:en.mw - 1010585 19438308049
 153+#projectcounts-20111130-210000:en.mw - 1243257 24115504214
 154+#projectcounts-20111130-220000:en.mw - 1327612 25904007706
 155+#projectcounts-20111130-230000:en.mw - 1355736 26490617282
 156+

Status & tagging log