StartProfiler.sample 1.7 KB

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