fix(driver): a CPU sample the driver never took is absent, not zero

CDP exposes no per-page CPU, so chrome's Metrics filled CPUPercent with a zero,
which is the same answer an idle app gives. Making the field optional is the
same fix as the iOS reads: absence is the only honest way to say nothing looked.
This commit is contained in:
pj committed 2026-08-22 21:41:40 +05:30
1 parent 577993b540
commit 1fb910e0a2
3 files changed
+8 -3

No files matched your search

+2 -1
View File
@@ -300,8 +300,9 @@ func (c *Client) Metrics(ctx context.Context, bundleID string) (driver.Metrics,
if err != nil {
return driver.Metrics{}, err
}
cpuPercent := response.GetCpuPercent()
return driver.Metrics{
CPUPercent: response.GetCpuPercent(),
CPUPercent: &cpuPercent,
HeapBytes: response.GetHeapBytes(),
TotalMemoryBytes: response.GetTotalMemoryBytes(),
}, nil