mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
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:
1 parent
577993b540
commit
1fb910e0a2
3 files changed
+8
-3
No files matched your search
@@ -183,7 +183,10 @@ type Health struct {
|
||||
}
|
||||
|
||||
type Metrics struct {
|
||||
CPUPercent float64
|
||||
// CPUPercent is nil on a driver that samples memory but not CPU, which
|
||||
// Chrome does: zero is a reading an idle app can produce, so a driver that
|
||||
// never looked has to answer with nothing rather than with that.
|
||||
CPUPercent *float64
|
||||
HeapBytes int64
|
||||
TotalMemoryBytes int64
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user