Profiler クラス
The profiler class allows you to add your own profiling information to the profiler. It implements a customized version of PHPQuickProfiler (PQP).
Configure runtime behaviour
The profiler contains a collection of javascript global variables through which you can control the initial state of the profiler.
-
PQP_SHOWONLOAD: boolean, if true, the profiler is opened on page load, if false. The default is false.
-
PQP_HEIGHT: string, "tall" shows double the info from "short". The default is "tall".
-
PQP_DETAILS: boolean, if false, no details will be shown, only the tab information. The default is true.
-
PQP_BOTTOM: boolean, if true, the profiler is attached to the bottom of the viewport. If false, it is displayed below the output. The default is true.
Example:
<script type="text/javascript">
var PQP_SHOWONLOAD = true;
var PQP_HEIGHT = 'short';
var PQP_DETAILS = true;
var PQP_BOTTOM = true;
</script>
Class methods
mark($label)
mark はスピードマーカーをプロファイラに追加します。
追加されたマーカーはプロファイラの "Load Time" セクションで確認することができます。
| 静的 |
はい |
| パラメータ |
| パラメータ |
デフォルト |
説明 |
| $label |
必須 |
スピードマーカーの説明 |
|
| 返り値 |
void |
| 例 |
Profiler::mark('これはメソッドの開始地点です');
|
mark_memory($var, $name)
mark_memoryはメモリマーカーをプロファイラに追加します。
変数を渡した場合、その変数のメモリ使用量が記録されます。
そうでない場合は、その時点でのメモリ使用量が記録されます。
| 静的 |
はい |
| パラメータ |
| パラメータ |
デフォルト |
説明 |
| $var |
false |
サイズを取得したい変数。もし、falseを渡すか、何も渡さない場合は全体のメモリ使用量が記録されます。 |
| $name |
'Memory Usage' |
マーカーの説明 |
|
| 返り値 |
void |
| 例 |
Profiler::mark_memory($this, 'Controller_Welcome オブジェクトです');
|
console($text)
console メソッドはログをプロファイラに追加します。
| 静的 |
はい |
| パラメータ |
| パラメータ |
デフォルト |
説明 |
| $text |
必須 |
プロファイラへ追加するログ |
|
| 返り値 |
void |
| 例 |
Profiler::console('start of this piece of code');
|