Skip to content

Commit f552d87

Browse files
thymikeeclaude
andauthored
feat(perf): time every Android command against the fixture app (#3902)
* feat(test-app): add a Bluesky-depth heavy feed screen A JavaScript-only route that reproduces a heavy React Native home feed: 30 nested containers above a virtualized list of composite posts with image, link, quote, and quote-with-media embeds. Its native accessibility tree is deeper than 65 levels, so XCTest tree capture fails with kAXErrorIllegalArgument and recovers through private AX, as on Bluesky 1.136. Settings links to it with open-heavy-feed. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(perf): time every iOS command against the fixture app pnpm perf --platform ios now drives the test app through seven scenarios that time each catalog command the iOS simulator serves, including the heavy feed and a raw capture with the XCTest tree backend pinned. The suite records a reason for every command it does not time, and a unit test keeps that partition complete. Each sample keeps the client daemon round trip and a phase profile from its --debug request log: runner commands, host process spawns, snapshot sources, retries, stabilization, and fallbacks. A run writes summary.json, report.md, and the raw daemon and session logs. The iOS Settings tour is removed; the Android tour stays as it was. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(perf): compare nightly iOS runs and run the suite every night (#3886) pnpm perf:compare judges one run against earlier runs: by default the seven nights before it, or a chosen run, date, range, or local output. A step's baseline is the median of its nightly medians. A change is flagged only when it is larger than 20%, three times the night-to-night scaled MAD, twice the run's own cv/sqrt(n), and 50 ms; new failures and fixed steps are flagged too. perf-nightly runs the iOS suite at 02:40 UTC again (#1781 A3). Each run uploads perf-ios-summary (90 days) and perf-ios-raw (30 days), and writes the comparison to the job summary with warnings for regressions and new failures. Android stays report-only behind a dispatch input. Co-authored-by: Claude Opus 5.5 <[email protected]> * fix(perf): judge nights, samples, and failures soundly; keep logs on interrupt - Rolling baselines take one scheduled run per UTC night (the newest usable one) and page through workflow runs until enough nights are found. Explicit --to/--from references still accept any trigger. - A run measures at least three rounds. A timing verdict needs three successful samples tonight and on each counted baseline night. - Failures get their own verdict. more-failures flags tonight failing more than every baseline night, in count and share; a faster median with worse failures is not an improvement. - The interrupt handler and the normal finish share one finalizer: save logs, stop session and daemon within a deadline, save again. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(perf): time every Android command against the fixture app Run iOS and Android from one shared suite: platform deltas are data on each step, and one harness owns rounds, sessions, and daemon restarts. The heavy-feed scenario times the Android helper's one-shot instrumentation capture by restarting the daemon with the helper session off. Request profiles name the helper transport that answered, adb spawns, and helper gestures. The nightly runs both platforms and compares each against its own nights; the Settings tour is removed. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(perf): keep Android clipboard and restore failures out of timings The API 35 and 36 emulator images ship no shell clipboard service, so clipboard is an Android exclusion. A daemon restart that reopens the session clears the stuck flag, and one that cannot reopen it skips the rest of the scenario as restore_failed. The one-shot step warms the restarted daemon's helper install check untimed. latest and date references resolve to the newest run with the platform's artifact. The tour-only --n alias is gone. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(perf): time every iOS command against the fixture app pnpm perf --platform ios now drives the test app through seven scenarios that time each catalog command the iOS simulator serves, including the heavy feed and a raw capture with the XCTest tree backend pinned. The suite records a reason for every command it does not time, and a unit test keeps that partition complete. Each sample keeps the client daemon round trip and a phase profile from its --debug request log: runner commands, host process spawns, snapshot sources, retries, stabilization, and fallbacks. A run writes summary.json, report.md, and the raw daemon and session logs. The iOS Settings tour is removed; the Android tour stays as it was. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(perf): compare nightly iOS runs and run the suite every night (#3886) pnpm perf:compare judges one run against earlier runs: by default the seven nights before it, or a chosen run, date, range, or local output. A step's baseline is the median of its nightly medians. A change is flagged only when it is larger than 20%, three times the night-to-night scaled MAD, twice the run's own cv/sqrt(n), and 50 ms; new failures and fixed steps are flagged too. perf-nightly runs the iOS suite at 02:40 UTC again (#1781 A3). Each run uploads perf-ios-summary (90 days) and perf-ios-raw (30 days), and writes the comparison to the job summary with warnings for regressions and new failures. Android stays report-only behind a dispatch input. Co-authored-by: Claude Opus 5.5 <[email protected]> * fix(perf): judge nights, samples, and failures soundly; keep logs on interrupt - Rolling baselines take one scheduled run per UTC night (the newest usable one) and page through workflow runs until enough nights are found. Explicit --to/--from references still accept any trigger. - A run measures at least three rounds. A timing verdict needs three successful samples tonight and on each counted baseline night. - Failures get their own verdict. more-failures flags tonight failing more than every baseline night, in count and share; a faster median with worse failures is not an improvement. - The interrupt handler and the normal finish share one finalizer: save logs, stop session and daemon within a deadline, save again. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(perf): pin the tree backend on a capture it serves, and share host readers - The forced-tree step ran a raw capture. The runner honors a backend pin only on the regular plan, so the raw plan recovered through private AX and the expectation passed a degraded row. The step is now a regular pinned capture on the home screen, and its expectation requires the pinned backend with the runner's `requested-backend` code. - Perf metadata reads the revision, toolchain, and simulator through the readers of the iOS snapshot benchmark, moved to scripts/lib/bench-host.ts. - host-kit and the daemon client export the phase names that the profiler reads. - summary-fixture.ts becomes summary.fixtures.ts; the nightly header matches 3 rounds. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(perf): read Android phase names from their emitters, and document the pinned capture - platform-android exports the helper capture and gesture phase names through its mechanics entry; the profiler and its test import them. - The README's snapshot-path section and parity table name the iOS pinned capture on home-reads and the reason code it must carry. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(perf): name the failed restore when restarting the daemon, and fix the local compare example Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(perf): keep the daemon request phase literal Only scripts read it, so a root export has no production consumer and fails the fallow audit. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(perf): stop the log stream right after it starts #3892 fixed the iOS simulator logs stop hang, so the untimed wait before logs-stop is no longer needed. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(android): record the answering helper transport on its capture timer The snapshot helper's capture timers now name the transport they drove, and the session timer records whether the session answered. profile.ts reads those fields per event instead of inferring a silent session from event order, and no longer re-spells the producer names platform-android owns. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 1d28b51 commit f552d87

30 files changed

Lines changed: 1103 additions & 784 deletions

‎.github/workflows/perf-nightly.yml‎

Lines changed: 75 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
name: Perf Nightly
22

3-
# Nightly iOS command performance against the fixture app, compared night over night (#1781 A3).
3+
# Nightly iOS and Android command performance against the fixture app, compared night over night
4+
# per platform (#1781 A3).
45
# - Catches: a command whose daemon time moves beyond the noise of earlier nights, or that starts
56
# failing. PR lanes check behavior, not time.
67
# - Wanted for: tuning runner, snapshot, and settle paths while watching the effect. iOS medians
78
# swing up to +122% between single nights, so a step is judged against the median of up to seven
89
# earlier nights and must clear their spread, its own sampling error, 20%, and 50 ms. A night
910
# runs 3 rounds, the minimum for a timing verdict, so one failed sample withholds that step's
1011
# timing verdict.
11-
# - Cost: one macos-26 job of about 45 minutes a night; summaries are kept 90 days, raw logs 30.
12+
# - Cost: one macos-26 job of about 45 minutes and one ubuntu emulator job a night; summaries are
13+
# kept 90 days, raw logs 30.
1214
# - Delete or park when: no flagged change has been acted on for 60 nights.
13-
# Android stays report-only and runs only on request.
1415

1516
on:
1617
schedule:
@@ -26,7 +27,7 @@ on:
2627
required: false
2728
default: '1'
2829
scenarios:
29-
description: 'Comma-separated iOS scenario ids (empty runs all)'
30+
description: 'Comma-separated scenario ids (empty runs all)'
3031
required: false
3132
default: ''
3233
baseline-nights:
@@ -37,8 +38,13 @@ on:
3738
description: 'Branch whose runs form the baseline'
3839
required: false
3940
default: 'main'
41+
ios:
42+
description: 'Run the iOS suite'
43+
type: boolean
44+
required: false
45+
default: true
4046
android:
41-
description: 'Also run the report-only Android Settings tour'
47+
description: 'Run the Android suite'
4248
type: boolean
4349
required: false
4450
default: true
@@ -58,6 +64,7 @@ env:
5864
jobs:
5965
perf-ios:
6066
name: iOS Command Perf
67+
if: ${{ github.event_name == 'schedule' || github.event.inputs.ios == 'true' }}
6168
runs-on: macos-26
6269
timeout-minutes: 100
6370
env:
@@ -133,7 +140,7 @@ jobs:
133140
BASELINE_BRANCH: ${{ github.event.inputs.baseline-branch || 'main' }}
134141
BASELINE_NIGHTS: ${{ github.event.inputs.baseline-nights || '7' }}
135142
run: |
136-
pnpm perf:compare --to perf-results \
143+
pnpm perf:compare --platform ios --to perf-results \
137144
--branch "$BASELINE_BRANCH" \
138145
--nights "$BASELINE_NIGHTS" \
139146
--exclude-run "$GITHUB_RUN_ID" \
@@ -164,26 +171,44 @@ jobs:
164171

165172
perf-android:
166173
name: Android Command Perf
167-
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.android == 'true' }}
174+
if: ${{ github.event_name == 'schedule' || github.event.inputs.android == 'true' }}
168175
runs-on: ubuntu-latest
169-
timeout-minutes: 80
170-
env:
171-
AGENT_DEVICE_PERF_CLI: '--experimental-strip-types src/bin.ts'
176+
timeout-minutes: 100
172177
steps:
173178
- name: Checkout
174179
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
175180

176181
- name: Setup toolchain
177182
uses: ./.github/actions/setup-node-pnpm
183+
with:
184+
cache-dependency-path: |
185+
pnpm-lock.yaml
186+
examples/test-app/pnpm-lock.yaml
187+
188+
- name: Build the shared CLI
189+
uses: ./.github/actions/run-gate
190+
with:
191+
gate: build
178192

179193
- name: Setup Android replay host
180-
id: android-replay-host
181194
uses: ./.github/actions/setup-android-replay-host
182195
with:
183196
package-helpers: 'true'
184197

185-
- name: Run Android command perf benchmark
198+
- name: Restore the fixture APK
199+
id: fixture-app
200+
uses: ./.github/actions/setup-fixture-app
201+
with:
202+
platform: android
203+
install: 'false'
204+
205+
# The emulator action runs each script line on its own, so the script is one folded line.
206+
- name: Run Android command perf suite
186207
uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b # v2.35.0
208+
env:
209+
APP_ID: ${{ steps.fixture-app.outputs.app-id }}
210+
APP_PATH: ${{ steps.fixture-app.outputs.apk-path }}
211+
SCENARIOS: ${{ github.event.inputs.scenarios }}
187212
with:
188213
api-level: 36
189214
arch: x86_64
@@ -192,15 +217,45 @@ jobs:
192217
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -no-metrics
193218
script: >-
194219
set -e;
195-
adb -s emulator-5554 shell settings put global window_animation_scale 0 || true;
196-
adb -s emulator-5554 shell settings put global transition_animation_scale 0 || true;
197-
adb -s emulator-5554 shell settings put global animator_duration_scale 0 || true;
198-
pnpm perf --platform android --serial emulator-5554 --n "$PERF_ROUNDS" --warmup "$PERF_WARMUP" --out-dir "$GITHUB_WORKSPACE/perf-results"
220+
adb -s emulator-5554 install -r "$APP_PATH";
221+
pnpm perf --platform android --serial emulator-5554
222+
--app-id "$APP_ID" --app-path "$APP_PATH"
223+
--rounds "$PERF_ROUNDS" --warmup "$PERF_WARMUP"
224+
${SCENARIOS:+--scenarios "$SCENARIOS"}
225+
--out-dir "$GITHUB_WORKSPACE/perf-results"
226+
227+
- name: Compare with earlier nights
228+
if: ${{ !cancelled() && hashFiles('perf-results/summary.json') != '' }}
229+
env:
230+
GH_TOKEN: ${{ github.token }}
231+
BASELINE_BRANCH: ${{ github.event.inputs.baseline-branch || 'main' }}
232+
BASELINE_NIGHTS: ${{ github.event.inputs.baseline-nights || '7' }}
233+
run: |
234+
pnpm perf:compare --platform android --to perf-results \
235+
--branch "$BASELINE_BRANCH" \
236+
--nights "$BASELINE_NIGHTS" \
237+
--exclude-run "$GITHUB_RUN_ID" \
238+
--out perf-results --github
239+
echo "Full report: the perf-android-summary artifact holds report.md and summary.json." >> "$GITHUB_STEP_SUMMARY"
240+
241+
- name: Upload Android perf summary
242+
if: ${{ !cancelled() && hashFiles('perf-results/summary.json') != '' }}
243+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
244+
with:
245+
name: perf-android-summary
246+
path: |
247+
perf-results/summary.json
248+
perf-results/report.md
249+
perf-results/comparison.json
250+
perf-results/comparison.md
251+
retention-days: 90
252+
if-no-files-found: error
199253

200-
- name: Upload Android perf report
201-
if: always()
254+
- name: Upload Android perf raw logs
255+
if: ${{ always() }}
202256
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
203257
with:
204-
name: perf-android
205-
path: perf-results/
258+
name: perf-android-raw
259+
path: perf-results/raw/
260+
retention-days: 30
206261
if-no-files-found: warn
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import { afterEach, beforeEach, test } from 'vitest';
2+
import assert from 'node:assert/strict';
3+
import { promises as fs } from 'node:fs';
4+
import path from 'node:path';
5+
import { withDiagnosticsScope } from '@agent-device/host-kit/diagnostics';
6+
import type { DeviceInfo } from '@agent-device/kernel/device';
7+
import {
8+
ANDROID_SNAPSHOT_HELPER_CAPTURE_PHASE as ONE_SHOT_PHASE,
9+
ANDROID_SNAPSHOT_HELPER_SESSION_CAPTURE_PHASE as SESSION_PHASE,
10+
snapshotAndroid,
11+
} from '../snapshot.ts';
12+
import { resetAndroidSnapshotHelperInstallCache } from '../snapshot-helper-install.ts';
13+
import { resetAndroidSnapshotHelperSessions } from '../snapshot-helper-session-lifecycle.ts';
14+
import { ANDROID_SNAPSHOT_HELPER_FIXTURE_ARTIFACT } from './test-utils/android-snapshot-helper.ts';
15+
import { createPersistentSnapshotHelperProvider } from './snapshot-helper-session.fixtures.ts';
16+
import { mkdtempForTest } from './test-utils/tmp-dir.ts';
17+
18+
const device: DeviceInfo = {
19+
platform: 'android',
20+
id: 'emulator-5554',
21+
name: 'Pixel',
22+
kind: 'emulator',
23+
booted: true,
24+
};
25+
26+
beforeEach(async () => {
27+
await resetAndroidSnapshotHelperSessions();
28+
resetAndroidSnapshotHelperInstallCache();
29+
});
30+
31+
afterEach(async () => {
32+
await resetAndroidSnapshotHelperSessions();
33+
});
34+
35+
async function captureTimers(sessionResponseMode?: 'malformed') {
36+
const provider = createPersistentSnapshotHelperProvider({
37+
calls: [],
38+
spawnArgs: [],
39+
processes: [],
40+
sessionResponseMode,
41+
oneShotXml: '<hierarchy><node text="one-shot fallback" bounds="[0,0][10,10]" /></hierarchy>',
42+
});
43+
const tmpDir = await mkdtempForTest('agent-device-android-capture-timers-');
44+
const logPath = path.join(tmpDir, 'diag.ndjson');
45+
try {
46+
await withDiagnosticsScope(
47+
{ debug: true, logPath, session: 'android-test', requestId: 'req-1', command: 'snapshot' },
48+
async () =>
49+
await snapshotAndroid(device, {
50+
helperAdb: provider,
51+
helperArtifact: ANDROID_SNAPSHOT_HELPER_FIXTURE_ARTIFACT,
52+
}),
53+
);
54+
return (await fs.readFile(logPath, 'utf8'))
55+
.split('\n')
56+
.filter(Boolean)
57+
.map((line) => JSON.parse(line) as { phase: string; data?: Record<string, unknown> })
58+
.filter(({ phase }) => phase === SESSION_PHASE || phase === ONE_SHOT_PHASE)
59+
.map(({ phase, data }) => ({ phase, transport: data?.transport, answered: data?.answered }));
60+
} finally {
61+
await fs.rm(tmpDir, { recursive: true, force: true });
62+
}
63+
}
64+
65+
test('each helper capture timer records its transport and whether the session answered', async () => {
66+
assert.deepEqual(await captureTimers(), [
67+
{ phase: SESSION_PHASE, transport: 'persistent-session', answered: true },
68+
]);
69+
await resetAndroidSnapshotHelperSessions();
70+
assert.deepEqual(await captureTimers('malformed'), [
71+
{ phase: SESSION_PHASE, transport: 'persistent-session', answered: false },
72+
{ phase: ONE_SHOT_PHASE, transport: 'instrumentation', answered: undefined },
73+
]);
74+
});

‎packages/platform-android/src/mechanics.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,12 @@ export {
308308
resetAndroidSnapshotHelperRuntime,
309309
retireAndroidSnapshotHelperAfterContentFailure,
310310
} from './snapshot-helper-runtime.ts';
311-
export { snapshotAndroid, type AndroidSnapshotOptions } from './snapshot.ts';
311+
export {
312+
ANDROID_SNAPSHOT_HELPER_CAPTURE_PHASE,
313+
ANDROID_SNAPSHOT_HELPER_SESSION_CAPTURE_PHASE,
314+
snapshotAndroid,
315+
type AndroidSnapshotOptions,
316+
} from './snapshot.ts';
312317
export { screenshotAndroid, type AndroidScreenshotOptions } from './screenshot.ts';
313318
export {
314319
ANDROID_SNAPSHOT_PRESENTATION_DEFAULT_DEADLINE_MS,
@@ -337,6 +342,7 @@ export { ensureAndroidSdkPathConfigured } from './sdk.ts';
337342
export { fillAndroid, typeAndroid } from './text-input.ts';
338343
export { executeAndroidTouchPlan, readAndroidGestureViewport } from './touch-executor.ts';
339344
export {
345+
ANDROID_TOUCH_HELPER_GESTURE_PHASE,
340346
ANDROID_TOUCH_PLAN_PROTOCOL,
341347
executeAndroidTouchHelperPlan,
342348
normalizeAndroidTouchHelperGestureRequest,

‎packages/platform-android/src/snapshot.ts‎

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import {
3636
ANDROID_SNAPSHOT_HELPER_COMMAND_TIMEOUT_MS,
3737
type AndroidHelperSessionScope,
3838
type AndroidSnapshotHelperCaptureOptions,
39+
type AndroidSnapshotHelperTransport,
3940
} from './snapshot-helper-types.ts';
4041
import {
4142
captureAndroidSnapshotWithHelper,
@@ -102,6 +103,19 @@ const HELPER_CONTENT_RECAPTURE_DELAY_MS = 250;
102103
* a busy screen run a snapshot past the daemon request envelope.
103104
*/
104105
const HELPER_CONTENT_RECAPTURE_WINDOW_MS = 10_000;
106+
/**
107+
* The diagnostic phase of a capture through the snapshot helper's persistent session. Its
108+
* `data.transport` names the session transport, and `data.answered` is false when the session
109+
* returned no capture (off, backed off, failed to start, or retired) and a one-shot capture follows.
110+
*/
111+
export const ANDROID_SNAPSHOT_HELPER_SESSION_CAPTURE_PHASE =
112+
'android_snapshot_helper_session_capture';
113+
/**
114+
* The diagnostic phase of a one-shot `am instrument` snapshot helper capture. Its `data.transport`
115+
* names the instrumentation transport.
116+
*/
117+
export const ANDROID_SNAPSHOT_HELPER_CAPTURE_PHASE = 'android_snapshot_helper_capture';
118+
105119
export type AndroidSnapshotOptions = SnapshotOptions & {
106120
idleWait?: AndroidSnapshotHelperCaptureOptions['idleWait'];
107121
appBundleId?: string;
@@ -463,15 +477,18 @@ async function captureAndroidUiHierarchyFromHelper(params: {
463477
signal,
464478
});
465479
captureOptions.idleWait = params.idleWait;
480+
let sessionCapture: AndroidSnapshotHelperOutput | undefined;
466481
try {
467-
const sessionCapture = await withDiagnosticTimer(
468-
'android_snapshot_helper_session_capture',
469-
async () => await captureAndroidSnapshotWithHelperSession(captureOptions),
470-
{
482+
sessionCapture = await withDiagnosticTimer(
483+
ANDROID_SNAPSHOT_HELPER_SESSION_CAPTURE_PHASE,
484+
async () => (sessionCapture = await captureAndroidSnapshotWithHelperSession(captureOptions)),
485+
() => ({
471486
packageName: artifact.manifest.packageName,
472487
version: artifact.manifest.version,
473488
timeoutMs: ANDROID_SNAPSHOT_HELPER_CAPTURE_TIMEOUT_MS,
474-
},
489+
transport: 'persistent-session' satisfies AndroidSnapshotHelperTransport,
490+
answered: sessionCapture !== undefined,
491+
}),
475492
);
476493
if (sessionCapture) return sessionCapture;
477494
} catch (error) {
@@ -487,13 +504,14 @@ async function captureAndroidUiHierarchyFromHelper(params: {
487504
await resetAndroidSnapshotHelperRuntime(adb, artifact.manifest.packageName);
488505
}
489506
return await withDiagnosticTimer(
490-
'android_snapshot_helper_capture',
507+
ANDROID_SNAPSHOT_HELPER_CAPTURE_PHASE,
491508
async () => await captureAndroidSnapshotWithHelper(captureOptions),
492509
{
493510
packageName: artifact.manifest.packageName,
494511
version: artifact.manifest.version,
495512
timeoutMs: ANDROID_SNAPSHOT_HELPER_CAPTURE_TIMEOUT_MS,
496513
commandTimeoutMs: ANDROID_SNAPSHOT_HELPER_COMMAND_TIMEOUT_MS,
514+
transport: 'instrumentation' satisfies AndroidSnapshotHelperTransport,
497515
},
498516
);
499517
}

‎packages/platform-android/src/touch-helper.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ import {
3333
} from './snapshot-helper-types.ts';
3434

3535
export const ANDROID_TOUCH_PLAN_PROTOCOL = 'android-touch-plan-v1';
36+
/** The diagnostic phase of one gesture that the snapshot helper injects. */
37+
export const ANDROID_TOUCH_HELPER_GESTURE_PHASE = 'android_touch_helper_gesture';
3638
const HELPER_GESTURE_TIMEOUT_MS = 45_000;
3739
const HELPER_GESTURE_TIMEOUT_OVERHEAD_MS = 15_000;
3840
const HELPER_VIEWPORT_TIMEOUT_MS = 45_000;
@@ -67,7 +69,7 @@ export async function executeAndroidTouchHelperPlan(
6769
JSON.stringify({ protocol: ANDROID_TOUCH_PLAN_PROTOCOL, ...request }),
6870
).toString('base64');
6971
const output = await withDiagnosticTimer(
70-
'android_touch_helper_gesture',
72+
ANDROID_TOUCH_HELPER_GESTURE_PHASE,
7173
async () => {
7274
// A live snapshot session already owns UiAutomation; injecting through it avoids the
7375
// instrumentation stop/restart that previously taxed every gesture. Gesture session errors

0 commit comments

Comments
 (0)