import { type FrameSample, type NativeUiPerformanceSourceResult, type PerformanceBackend, type PerformanceCaptureResult, type TraceClockSync, type TraceEvent } from '@farmslot/recipe-runner/runtime/cdp-trace'; export interface AndroidGfxinfoPerformanceOptions { /** adb serial of the device. */ serial: string; /** Application id whose frames are read, e.g. `com.example.app`. */ packageId: string; /** adb binary; `adb` on PATH by default. */ adbPath?: string; /** Where `describe()` reports an adb read it had to skip; console by default. */ logger?: Pick; /** * Also read the `[farmslot-perf] shown ` lines the app logs from * `adb logcat` during each capture (`shownMarkers` on the result). */ shownMarkers?: boolean; } /** An app's `[farmslot-perf] shown ` logcat line. */ export interface AndroidShownMarker { screen: string; atEpochMs: number; } /** A gfxinfo frame: a recipe-runner frame sample plus what the UI thread did in it. */ export interface AndroidFrameSample extends FrameSample { startedAtEpochMs: number; /** The frame handled an input event (a touch or key reached the app in it). */ input?: true; /** UI-thread time from the frame's vsync until it handed the frame to the render thread. */ uiThreadMs?: number; } export interface AndroidGfxinfoCaptureResult extends PerformanceCaptureResult<'android'> { nativeUi: NativeUiPerformanceSourceResult & { samples: AndroidFrameSample[]; }; /** `missing` when the device's framestats has no InputEventId column (before Android 12). */ inputEvents: 'available' | 'missing'; /** With the `shownMarkers` option: the marker lines read, or why logcat gave none. */ shownMarkers?: { markers: AndroidShownMarker[]; unavailableReason?: string; }; } /** What a report says about the device and app it measured. */ export interface AndroidDeviceDescription { serial: string; model?: string; androidRelease?: string; packageId: string; versionName?: string; versionCode?: string; /** `debug` when the installed package is debuggable. */ buildType?: 'debug' | 'release'; lastUpdateTime?: string; } export interface AndroidGfxinfoPerformanceBackend extends PerformanceBackend<'android'> { end(id: string): Promise; describe?(): Promise; } export interface AndroidFrameRow { completedNs: number; deadlineNs: number; frameIntervalNs: number; inputEventId: string; intendedVsyncNs: number; syncQueuedNs: number; vsyncId: string; vsyncNs: number; } export interface AndroidClockSync { hostEpochAtDeviceUptimeMs: number; uncertaintyMs: number; } interface ParsedFrameStats { bufferCapacityReached: boolean; frames: AndroidFrameRow[]; /** False when a framestats header had no InputEventId column. */ inputEventColumn: boolean; } export declare function createAndroidGfxinfoPerformanceBackend(options: AndroidGfxinfoPerformanceOptions): AndroidGfxinfoPerformanceBackend; /** `[farmslot-perf] shown ` lines of `adb logcat -v monotonic` output, on the host clock. */ export declare function parseShownMarkers(output: string, clock: AndroidClockSync): AndroidShownMarker[]; export declare function androidFrameSample(row: AndroidFrameRow, clock: AndroidClockSync, fallbackBudgetMs: number | undefined): AndroidFrameSample; export declare function parseFrameStats(output: string): ParsedFrameStats; export declare function buildAndroidFrameTraceEvents(rows: readonly AndroidFrameRow[], clock: AndroidClockSync, fallbackBudgetMs: number | undefined): TraceEvent[]; /** The host epoch of device uptime 0, from the host-clock midpoint of the read that printed `Uptime:`. */ export declare function androidClockSync(midpoint: TraceClockSync, deviceUptimeMs: number): AndroidClockSync; export {}; //# sourceMappingURL=android-gfxinfo-performance.d.ts.map