r36103 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36102‎ | r36103 | r36104 >
Date:20:30, 9 June 2008
Author:brion
Status:old
Tags:
Comment:
Merge live hack --oom-adj option...
I'm sick of svn up conflicts, commit your changes guys! :)
Modified paths:
  • /trunk/extensions/DumpHTML/dumpHTML.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DumpHTML/dumpHTML.php
@@ -28,12 +28,14 @@
2929 --image-snapshot copy all images used to the destination directory
3030 --compress generate compressed version of the html pages
3131 --udp-profile <N> profile 1/N rendering operations using ProfilerSimpleUDP
 32+ --oom-adj <N> set /proc/<pid>/oom_adj
 33+ --show-titles write each article title to stdout
3234
3335 ENDS;
3436
3537 define( 'MW_HTML_FOR_DUMP', 1 );
3638
37 -$optionsWithArgs = array( 's', 'd', 'e', 'k', 'checkpoint', 'slice', 'udp-profile' );
 39+$optionsWithArgs = array( 's', 'd', 'e', 'k', 'checkpoint', 'slice', 'udp-profile', 'oom-adj' );
3840 $options = array( 'help' );
3941 $profiling = false;
4042
@@ -68,6 +70,12 @@
6971 exit;
7072 }
7173
 74+if ( !wfIsWindows() && isset( $options['oom-adj'] ) ) {
 75+ $adj = intval( $options['oom-adj'] );
 76+ $pid = getmypid();
 77+ file_put_contents( "/proc/$pid/oom_adj", $adj );
 78+}
 79+
7280 if ( !empty( $options['s'] ) ) {
7381 $start = $options['s'];
7482 } else {
@@ -117,6 +125,7 @@
118126 'compress' => $options['compress'],
119127 'noSharedDesc' => $options['no-shared-desc'],
120128 'udpProfile' => $options['udp-profile'],
 129+ 'showTitles' => $options['show-titles'],
121130 ));
122131
123132 $wgHTMLDump->setupDestDir();

Status & tagging log