X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=StartProfiler.sample;h=d20c0e1bd9d8a8d2aeb68d57de06fec8ba44e5d1;hb=c3704788f97ad34911dea35c92cfe7d05cce6e0a;hp=d9b52884119809412d4e80ccb84c648075f891fe;hpb=5ca4bea3d380911c458659e653320497e501d23c;p=lhc%2Fweb%2Fwiklou.git diff --git a/StartProfiler.sample b/StartProfiler.sample index d9b5288411..d20c0e1bd9 100644 --- a/StartProfiler.sample +++ b/StartProfiler.sample @@ -3,24 +3,31 @@ /** * To use a profiler, copy this file to StartProfiler.php, * and add either: + * $wgProfiler['class'] = 'ProfilerStandard'; + * or + * $wgProfiler['class'] = 'ProfilerXhprof'; * - * // Does not support the debugging toolbar - * // Stores profiling information in the database - * // Requires running maintenance/archives/patch-profiling.sql - * $wgProfiler['class'] = 'ProfilerSimpleDB' + * 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: + * 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; * - * // Supports the debugging toolbar - * // Does not store profiling information in the database - * $wgProfiler['class'] = 'ProfilerStandard'; + * The 'db' output expects a database table that can be created by applying + * maintenance/archives/patch-profiling.sql to your database. * - * Or for a sampling profiler: - * if ( !mt_rand( 0, 100 ) ) { - * $wgProfiler['class'] = 'ProfilerSimpleDB'; - * } else { - * $wgProfiler['class'] = 'ProfilerStub'; - * } + * 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. * - * Configuration of the profiler output can be done in LocalSettings.php + * 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. */