2009-05-07 07:27:01 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/**
|
2015-01-08 09:30:05 +00:00
|
|
|
* To use a profiler, copy this file to StartProfiler.php and add:
|
2014-11-14 18:58:07 +00:00
|
|
|
* $wgProfiler['class'] = 'ProfilerXhprof';
|
2009-05-07 07:27:01 +00:00
|
|
|
*
|
2015-04-02 17:46:57 +00:00
|
|
|
* For output, set the 'output' key to an array of class names, one for each
|
|
|
|
|
* output type you want the profiler to generate. For example:
|
|
|
|
|
* $wgProfiler['output'] = array( 'ProfilerOutputText' );
|
2014-07-07 22:10:23 +00:00
|
|
|
*
|
2015-04-02 17:46:57 +00:00
|
|
|
* The output classes available to you by default are ProfilerOutputDb,
|
|
|
|
|
* ProfilerOutputDump, ProfilerOutputStats, ProfilerOutputText, and
|
|
|
|
|
* ProfilerOutputUdp.
|
|
|
|
|
*
|
|
|
|
|
* ProfilerOutputStats outputs profiling data as StatsD metrics. It expects
|
|
|
|
|
* that you have set the $wgStatsdServer configuration variable to the host (or
|
|
|
|
|
* host:port) of your statsd server.
|
|
|
|
|
*
|
|
|
|
|
* ProfilerOutputText will output profiling data in the page body as a comment.
|
|
|
|
|
* You can make the profiling data in HTML render as part of the page content
|
|
|
|
|
* by setting the 'visible' configuration flag:
|
2014-11-14 18:58:07 +00:00
|
|
|
* $wgProfiler['visible'] = true;
|
2014-07-07 22:10:23 +00:00
|
|
|
*
|
2015-04-02 17:46:57 +00:00
|
|
|
* 'ProfilerOutputDb' expects a database table that can be created by applying
|
2014-12-04 21:40:13 +00:00
|
|
|
* maintenance/archives/patch-profiling.sql to your database.
|
2009-05-07 07:27:01 +00:00
|
|
|
*
|
2015-04-02 17:46:57 +00:00
|
|
|
* 'ProfilerOutputDump' expects a $wgProfiler['outputDir'] telling it where to
|
2015-03-03 23:17:02 +00:00
|
|
|
* write dump files. The files produced are compatible with the XHProf gui.
|
2014-11-14 18:58:07 +00:00
|
|
|
* For a rudimentary sampling profiler:
|
2015-01-07 19:31:34 +00:00
|
|
|
* $wgProfiler['class'] = 'ProfilerXhprof';
|
2015-04-03 00:42:41 +00:00
|
|
|
* $wgProfiler['output'] = array( 'ProfilerOutputDb' );
|
2014-11-21 22:54:57 +00:00
|
|
|
* $wgProfiler['sampling'] = 50; // one every 50 requests
|
|
|
|
|
* This will use ProfilerStub for non-sampled cases.
|
|
|
|
|
*
|
2015-04-02 17:46:57 +00:00
|
|
|
* 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.
|
2009-05-07 07:27:01 +00:00
|
|
|
*/
|