(
udid: string,
options: {
pid?: number | null;
windowMs?: number;
request?: RequestInit;
} = {},
)
| 145 | } |
| 146 | |
| 147 | export async function fetchSimulatorPerformance( |
| 148 | udid: string, |
| 149 | options: { |
| 150 | pid?: number | null; |
| 151 | windowMs?: number; |
| 152 | request?: RequestInit; |
| 153 | } = {}, |
| 154 | ): Promise<SimulatorPerformanceResponse> { |
| 155 | const params = new URLSearchParams(); |
| 156 | if (options.pid != null) { |
| 157 | params.set("pid", String(options.pid)); |
| 158 | } |
| 159 | if (options.windowMs != null) { |
| 160 | params.set("windowMs", String(options.windowMs)); |
| 161 | } |
| 162 | const query = params.size > 0 ? `?${params}` : ""; |
| 163 | return apiRequest<SimulatorPerformanceResponse>( |
| 164 | `/api/simulators/${encodeURIComponent(udid)}/performance${query}`, |
| 165 | options.request ?? {}, |
| 166 | ); |
| 167 | } |
| 168 | |
| 169 | export async function sampleSimulatorProcess( |
| 170 | udid: string, |
no test coverage detected