Naify\App\Profiler\TextRenderer クラス

プロファイラ Text レンダラー — AI/CLI 観測向けテキスト出力

ページへ埋め込む UI ではなく、ヘッダー・環境情報・バッジ・詳細トレースを プレーンテキストで返す。nf_ob_profiler=1 のような「本文を捨てて profiler だけ観測したい」場面を主な用途とする。

使用例

echo TextRenderer::renderProfiler($profiler);

メソッド

メソッド説明
public static renderProfiler(Profiler $profiler): string Profiler 全体を AI/CLI 観測向けテキストとして描画する
private static appendLines(array $lines, array $headers): void ヘッダー行を整形して追加する
private static appendTraceTree(array $lines, array $nodes, int $depth): void tree 形式のトレースを行単位テキストへ落とす
private static appendCheckpointTrace(array $lines, array $checkpoints, float $startTime): void tree がない場合に checkpoint 一覧から trace を組み立てる
private static formatBytes(int $bytes): string バイト数を人間が読みやすい形式へ変換する
private static formatFloat(float $value): string 小数を固定フォーマットで返す
private static encodeInline(string $value): string 1 行値を JSON 風に安全化する
private static isOpCacheEnabled(): bool OPcache が有効かどうか
private static isJitEnabled(): bool JIT が有効かどうか