更新
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace app\adminapi\service;
|
||||
|
||||
use app\common\service\DifyStreamTiming;
|
||||
use think\facade\Log;
|
||||
|
||||
/** A request-local, patient-free timing record for the diagnosis assistant SSE path. */
|
||||
@@ -91,4 +92,15 @@ final class AssistantSseTiming
|
||||
// Telemetry must never interrupt the clinical request.
|
||||
}
|
||||
}
|
||||
|
||||
/** The typed collector exposes only bounded numeric timing and enum metadata. */
|
||||
public function logUpstream(DifyStreamTiming $upstream): void
|
||||
{
|
||||
try {
|
||||
Log::write('diagnosis ai upstream stages ' . json_encode([
|
||||
'trace_id' => $this->traceId, 'request_elapsed_ms' => self::elapsedMs($this->startedAt),
|
||||
'timing' => $upstream->snapshot(),
|
||||
]), 'info');
|
||||
} catch (\Throwable $ignored) {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user