X-Git-Url: https://git.cyclocoop.org/%28%28?a=blobdiff_plain;f=StartProfiler.sample;h=d20c0e1bd9d8a8d2aeb68d57de06fec8ba44e5d1;hb=4e26d0c8941082c60e51c1096cd0e4b0adbce7fa;hp=db5e0ff9e261adad18a34551a204b11aec254b0f;hpb=ed4db4af0a23379be7b452494a0e20c07458f6c0;p=lhc%2Fweb%2Fwiklou.git diff --git a/StartProfiler.sample b/StartProfiler.sample index db5e0ff9e2..d20c0e1bd9 100644 --- a/StartProfiler.sample +++ b/StartProfiler.sample @@ -2,16 +2,32 @@ /** * To use a profiler, copy this file to StartProfiler.php, - * and add something like this: + * and add either: + * $wgProfiler['class'] = 'ProfilerStandard'; + * or + * $wgProfiler['class'] = 'ProfilerXhprof'; * - * $wgProfiler['class'] = 'Profiler'; + * For output, add: + * $wgProfiler['output'] = array( 'text' ); + * 'text' can be one (or more) of 'text' 'udp' or 'db' + * 'db' requires creating the profiling table, see patch-profiling.sql * - * Or for a sampling profiler: - * if ( !mt_rand( 0, 100 ) ) { - * $wgProfiler['class'] = 'Profiler'; - * } else { - * $wgProfiler['class'] = 'ProfilerStub'; - * } + * The 'text' output will be added to the output page in a comment approriate + * to the output's mime type. For a text/html page, this display can be + * changed to a preformatted text block by setting the 'visible' configuration + * flag: + * $wgProfiler['visible'] = true; * - * Configuration of the profiler output can be done in LocalSettings.php + * The 'db' output expects a database table that can be created by applying + * maintenance/archives/patch-profiling.sql to your database. + * + * For a rudimentary sampling profiler: + * $wgProfiler['class'] = 'ProfilerStandard'; + * $wgProfiler['output'] = array( 'db' ); + * $wgProfiler['sampling'] = 50; // one every 50 requests + * This will use ProfilerStub for non-sampled cases. + * + * For performance, the profiler is always disabled for CLI scripts + * as they could be long running and the data would accumulate. Use + * the --profiler parameter of maintenance scripts to override this. */