Files
Rocky 956331a2af chore(release): bump version to 1.0.1 (build 27)
Release the current PiP reliability, polish style, macOS dictionary, and UI updates.
2026-07-27 00:09:30 +08:00

54 lines
1.8 KiB
Swift

// FlowPipelineDiagnostics.swift
// OSGKeyboard · Shared
//
// Structured Flow pipeline metrics for Console.app filtering.
import Foundation
import os
public enum FlowPipelineDiagnostics {
public static func logDrain(_ report: FlowCaptureDrainReport) {
OSGLog.flow.info(
"tailDrain duration=\(report.drainDurationSeconds, format: .fixed(precision: 2))s postRoll=\(report.postRollDurationSeconds, format: .fixed(precision: 2))s silenceEnd=\(report.endedBySilence) tailSamples=\(report.tailSampleCount)"
)
}
public static func logTranscriptGuardUsedPartial(finalLength: Int, partialLength: Int) {
OSGLog.flow.warning(
"transcriptGuard partial preferred finalLen=\(finalLength) partialLen=\(partialLength)"
)
}
public static func logFinalChunkRecovery(action: String, chunkIndex: Int) {
OSGLog.asr.info("finalChunkRecovery \(action) chunk=\(chunkIndex)")
}
public static func logBatchFallback(
sampleCount: Int,
stitchedLength: Int,
partialLength: Int,
batchLength: Int
) {
OSGLog.flow.info(
"batchFallback samples=\(sampleCount) stitchedLen=\(stitchedLength) partialLen=\(partialLength) batchLen=\(batchLength)"
)
}
public static func logChunkFinalize(
chunkCount: Int,
lastChunkSamples: Int,
stitchedLength: Int,
chunkWarnings: Int
) {
OSGLog.flow.info(
"chunkPipeline chunks=\(chunkCount) lastChunkSamples=\(lastChunkSamples) stitchedLen=\(stitchedLength) warnings=\(chunkWarnings)"
)
}
public static func logStitcherSafeFallback(naiveLength: Int, mergedLength: Int) {
OSGLog.asr.warning(
"stitcher safe fallback naive=\(naiveLength) merged=\(mergedLength)"
)
}
}