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

Function sampleAndroidFramePerf

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

Source from the content-addressed store, hash-verified

19};
20
21export async function sampleAndroidFramePerf(
22 device: DeviceInfo,
23 packageName: string,
24 options: AndroidFramePerfOptions = {},
25): Promise<AndroidFramePerfSample> {
26 const adb = resolveAndroidAdbExecutor(device, options.adb);
27 try {
28 const result = await adb(['shell', 'dumpsys', 'gfxinfo', packageName, 'framestats'], {
29 timeoutMs: ANDROID_FRAME_PERF_TIMEOUT_MS,
30 });
31 const sample = parseAndroidFramePerfSample(
32 result.stdout,
33 packageName,
34 new Date().toISOString(),
35 );
36 await resetAndroidFramePerfStats(device, packageName, options);
37 return sample;
38 } catch (error) {
39 throw annotateAndroidFramePerfSamplingError(packageName, error);
40 }
41}
42
43export async function resetAndroidFramePerfStats(
44 device: DeviceInfo,

Callers 3

applyFramePerfMetricFunction · 0.90
sampleAndroidPerfResultsFunction · 0.90

Calls 5

adbFunction · 0.50

Tested by

no test coverage detected