Skip to content

Report CPU state via Compute Pressure API#3230

Merged
hensmi-amazon merged 2 commits into
mainfrom
compute-pressure
Jun 15, 2026
Merged

Report CPU state via Compute Pressure API#3230
hensmi-amazon merged 2 commits into
mainfrom
compute-pressure

Conversation

@hensmi-amazon

Copy link
Copy Markdown
Contributor

Issue #: N/A

Description of changes:
Add a CPU_PRESSURE_STATE SdkMetric (=113) and a ComputePressureMonitor that wraps the browser PressureObserver. StatsCollector owns the monitor's lifetime and appends the latest sample (nominal=0, fair=1, serious=2, critical=3) to each global metric frame. The class is internal — added to barrelize.js ignoredTypes alongside StatsCollector.

Testing:
On my macos can emit both 0 and 1

Can these tested using a demo application? Please provide reproducible step-by-step instructions.

No

Checklist:

  1. Have you successfully run npm run build:release locally?
    y

  2. Do you add, modify, or delete public API definitions? If yes, has that been reviewed and approved?
    n

  3. Do you change the wire protocol, e.g. the request method? If yes, has that been reviewed and approved?
    n

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Add a CPU_PRESSURE_STATE SdkMetric (=113) and a ComputePressureMonitor
that wraps the browser PressureObserver. The monitor returns the raw
pressure state string; StatsCollector owns the wire encoding
(nominal=0, fair=1, serious=2, critical=3) and appends the latest
sample to each global metric frame. The class is internal — added to
barrelize.js ignoredTypes alongside StatsCollector.
@hensmi-amazon hensmi-amazon requested a review from a team as a code owner June 15, 2026 18:32
@hensmi-amazon hensmi-amazon enabled auto-merge (squash) June 15, 2026 21:37
@hensmi-amazon hensmi-amazon merged commit 91fd9a9 into main Jun 15, 2026
7 checks passed
@hensmi-amazon hensmi-amazon deleted the compute-pressure branch June 15, 2026 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants