このページは2007年 10月 19日, 00:47に更新されました by RoyK

Profiling

From $1

Profiling PHP code

Add Profiling.php into your /includes/ folder. In LocalSettings.php, add:

$wgProfiling = true;
$wgDebugLogFile = 'debug.txt';

 Then load any page in your wiki; debug.txt will then be populated with load times between breakpoints. To set breakpoints, add:

wfProfileIn('name-profiled-code');
... CODE ... 
wfProfileOut('name-profiled-code');

Profiling API times from PHP

You can also profile all the API calls by setting:

$wgProfileApi = true;

This will create a list of all the API calls and their execution time; you'll have to do a "View HTML Source" in your browser to see the times. There are two times reported: Total and Real. Real time is simply the time for all unique queries (this indicates a PHP inefficiency as it is making many of the same calls over).

タグ:
ファイルサイズ日付添付したユーザ 
 Profiling.php
説明なし
8.26 kB2007年 10月 19日, 00:47RoyKアクション
コメント(0)
あなたはコメントを投稿するには ログイン しなければなりません。