Jump to content

Manual: $wgProfiler

From mediawiki.org
This page is a translated version of the page Manual:$wgProfiler and the translation is 54% complete.
Profiling: $wgProfiler
Definições relacionadas com traçar perfil.
Introduzido na versão:1.8.0
Removido na versão:Ainda em utilização
Valores permitidos:(matriz associativa)
Valor predefinido:[]

Detalhes

Esta definição é utilizada configurar o perfilar da sua instalação do MediaWiki.

Para ver as chaves disponíveis, consulte Manual: Perfilar . Elas incluem:

'class'
Por exemplo, ProfilerXhprof fornece um 'traçar perfil' com o apoio de Xhprof. Há também ProfilerExcimer que funciona com Excimer .
'output'
Defina um ou múltiplos métodos de saída. For multiple output methods at the same time, use an array of class names, one for each output type you want the profiler to generate. For example use the "ProfilerOutputText" profiler. The output classes available to you by default are: ProfilerOutputDump, ProfilerOutputStats, ProfilerOutputText.
  • 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: $wgProfiler['visible'] = true;

  • ProfilerOutputDump expects a $wgProfiler['outputDir'] telling it where to write dump files.

The files produced are compatible with the XHProf gui.

'visible'
true ou false. If true, output is displayed in HTML rendering (and not only in a comment).
'sampling'
Inteiro positivo. Profile every nth request.

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.

Exemplo

Para um 'traçar perfil' de depuração rudimentar:

$wgProfiler= [
  'class' => ProfilerXhprof::class,
  'output' => ProfilerOutputText::class,
];

Consultar também