NaifyView\Observation\ProfilerBridge クラス

ProfilerBridge — Naify profiler へ NaifyView 観測点を薄く流す bridge

NaifyView は単体パッケージとして自前の Profiler を持つ。 Naify が同じ request で起動している場合だけ、class_exists() ガード越しに Naify::profiler() へ checkpoint / section を複写する。

使用例

// 通常は Profiler::setLevel() や ViewConfigurator::useProfiler() から間接利用する。
// Naify が同じ request にいれば、観測点だけを Naify::profiler() へ流す。

プロパティ

名前型説明
private static $profilerInstance object|false|null request 中に再利用する Naify profiler instance

メソッド

メソッド説明
public static clearProcessCaches(): void process 単位で持っている host profiler 参照 cache をクリアする
private static hasNaify(): bool `hasNaify()` かを返す
private static resolveProfiler(): ?object `resolveProfiler()` を実行する
public static isEnabled(): bool `isEnabled()` かを返す
public static getLevel(): string `getLevel()` の値を返す
public static isAtLeastLevel(string $level): bool `isAtLeastLevel()` かを返す
public static isObservationEnabled(): bool `isObservationEnabled()` かを返す
public static getObservationLevel(): string `getObservationLevel()` の値を返す
public static setObservationEnabled(bool $enabled): void `setObservationEnabled()` の値を設定する
public static setLevel(string $level): void `setLevel()` の値を設定する
public static checkpoint(string $label): void `checkpoint()` を実行する
public static beginSection(string $label): void `beginSection()` を実行する
public static endSection(): void `endSection()` を実行する
public static addBadge(string $label, string $value, string $style = info, string $description = ): void `addBadge()` を追加する
public static addInfo(string $message): void `addInfo()` を追加する
public static normalizeLevel(mixed $level): string `normalizeLevel()` を実行する
private static levelRank(string $level): int `levelRank()` を実行する