wiki.techinc.nl/StartProfiler.sample
Aaron Schulz 66170e7e59 Adding basic profiler sampling support and restored the --profiler script option
* Also enforce that the profiler is normally off in CLI mode

Change-Id: I35faedff818af2ad459b544c9ad50e77b54b378e
2014-11-21 15:14:18 -08:00

33 lines
1.2 KiB
Text

<?php
/**
* To use a profiler, copy this file to StartProfiler.php,
* and add either:
* $wgProfiler['class'] = 'ProfilerStandard';
* or
* $wgProfiler['class'] = 'ProfilerXhprof';
*
* 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
*
* 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;
*
* 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.
*/