]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blob - StartProfiler.sample
MediaWiki 1.30.2-scripts2
[autoinstalls/mediawiki.git] / StartProfiler.sample
1 <?php
2
3 /**
4  * To use a profiler, copy this file to StartProfiler.php and add:
5  *  $wgProfiler['class'] = 'ProfilerXhprof';
6  *
7  * For output, set the 'output' key to an array of class names, one for each
8  * output type you want the profiler to generate. For example:
9  *  $wgProfiler['output'] = array( 'ProfilerOutputText' );
10  *
11  * The output classes available to you by default are ProfilerOutputDb,
12  * ProfilerOutputDump, ProfilerOutputStats, ProfilerOutputText, and
13  * ProfilerOutputUdp.
14  *
15  * ProfilerOutputStats outputs profiling data as StatsD metrics. It expects
16  * that you have set the $wgStatsdServer configuration variable to the host (or
17  * host:port) of your statsd server.
18  *
19  * ProfilerOutputText will output profiling data in the page body as a comment.
20  * You can make the profiling data in HTML render as part of the page content
21  * by setting the 'visible' configuration flag:
22  *  $wgProfiler['visible'] = true;
23  *
24  * 'ProfilerOutputDb' expects a database table that can be created by applying
25  * maintenance/archives/patch-profiling.sql to your database.
26  *
27  * 'ProfilerOutputDump' expects a $wgProfiler['outputDir'] telling it where to
28  * write dump files. The files produced are compatible with the XHProf gui.
29  * For a rudimentary sampling profiler:
30  *   $wgProfiler['class'] = 'ProfilerXhprof';
31  *   $wgProfiler['output'] = array( 'ProfilerOutputDb' );
32  *   $wgProfiler['sampling'] = 50; // one every 50 requests
33  * This will use ProfilerStub for non-sampled cases.
34  *
35  * For performance, the profiler is always disabled for CLI scripts as they
36  * could be long running and the data would accumulate. Use the '--profiler'
37  * parameter of maintenance scripts to override this.
38  */