MCPcopy Index your code
hub / github.com/callstack/agent-device / resetAndroidFramePerfStats

Function resetAndroidFramePerfStats

src/platforms/android/perf-frame.ts:43–57  ·  view source on GitHub ↗
(
  device: DeviceInfo,
  packageName: string,
  options: AndroidFramePerfOptions = {},
)

Source from the content-addressed store, hash-verified

41}
42
43export async function resetAndroidFramePerfStats(
44 device: DeviceInfo,
45 packageName: string,
46 options: AndroidFramePerfOptions = {},
47): Promise<void> {
48 const adb = resolveAndroidAdbExecutor(device, options.adb);
49 try {
50 await adb(['shell', 'dumpsys', 'gfxinfo', packageName, 'reset'], {
51 allowFailure: true,
52 timeoutMs: ANDROID_FRAME_RESET_TIMEOUT_MS,
53 });
54 } catch {
55 // Reset is best-effort; sampling/open should still succeed if adb times out or disappears.
56 }
57}
58
59function annotateAndroidFramePerfSamplingError(packageName: string, error: unknown): AppError {
60 if (error instanceof AppError) {

Callers 3

completeOpenCommandFunction · 0.90
sampleAndroidFramePerfFunction · 0.85

Calls 2

adbFunction · 0.50

Tested by

no test coverage detected