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

Function sampleAndroidMemoryPerf

src/platforms/android/perf.ts:100–114  ·  view source on GitHub ↗
(
  device: DeviceInfo,
  packageName: string,
  options: AndroidPerfOptions = {},
)

Source from the content-addressed store, hash-verified

98}
99
100export async function sampleAndroidMemoryPerf(
101 device: DeviceInfo,
102 packageName: string,
103 options: AndroidPerfOptions = {},
104): Promise<AndroidMemoryPerfSample> {
105 const adb = resolveAndroidAdbExecutor(device, options.adb);
106 try {
107 const result = await adb(['shell', 'dumpsys', 'meminfo', packageName], {
108 timeoutMs: ANDROID_PERF_TIMEOUT_MS,
109 });
110 return parseAndroidMemInfoSample(result.stdout, packageName, new Date().toISOString());
111 } catch (error) {
112 throw annotateAndroidPerfSamplingError('memory', packageName, error);
113 }
114}
115
116export async function captureAndroidHeapSnapshot(
117 device: DeviceInfo,

Callers 2

sampleAndroidPerfResultsFunction · 0.90
buildMemorySampleMetricFunction · 0.90

Calls 4

adbFunction · 0.50

Tested by

no test coverage detected