Skip to content

Document Compute Pressure API - #32923

Merged
wbamberg merged 13 commits into
mdn:mainfrom
Elchi3:compute-pressure
May 14, 2024
Merged

Document Compute Pressure API#32923
wbamberg merged 13 commits into
mdn:mainfrom
Elchi3:compute-pressure

Conversation

@Elchi3

@Elchi3 Elchi3 commented Apr 2, 2024

Copy link
Copy Markdown
Member

Description

This pull request documents the Compute Pressure API.

Technical reviewers: @kenchris, @arskama

Additional details

This PR creates the following pages:

A more hands-on "Using the Compute Pressure API" guide page could be added in a follow-up PR.

Related issues and pull requests

@github-actions github-actions Bot added Content:WebAPI Web API docs Content:HTTP HTTP docs size/l [PR only] 501-1000 LoC changed labels Apr 2, 2024
@github-actions

github-actions Bot commented Apr 2, 2024

Copy link
Copy Markdown
Contributor
Preview URLs (16 pages)
Flaws (14)

Note! 2 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/API/Compute_Pressure_API
Title: Compute Pressure API
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: api.PressureObserver

URL: /en-US/docs/Web/API/PressureRecord
Title: PressureRecord
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: api.PressureRecord

URL: /en-US/docs/Web/API/PressureRecord/toJSON
Title: PressureRecord: toJSON() method
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: api.PressureRecord.toJSON

URL: /en-US/docs/Web/API/PressureRecord/state
Title: PressureRecord: state property
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: api.PressureRecord.state

URL: /en-US/docs/Web/API/PressureRecord/source
Title: PressureRecord: source property
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: api.PressureRecord.source

URL: /en-US/docs/Web/API/PressureRecord/time
Title: PressureRecord: time property
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: api.PressureRecord.time

URL: /en-US/docs/Web/API/PressureObserver
Title: PressureObserver
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: api.PressureObserver

URL: /en-US/docs/Web/API/PressureObserver/unobserve
Title: PressureObserver: unobserve() method
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: api.PressureObserver.unobserve

URL: /en-US/docs/Web/API/PressureObserver/knownSources_static
Title: PressureObserver: knownSources static property
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: api.PressureObserver.knownSources_static

URL: /en-US/docs/Web/API/PressureObserver/observe
Title: PressureObserver: observe() method
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: api.PressureObserver.observe

URL: /en-US/docs/Web/API/PressureObserver/takeRecords
Title: PressureObserver: takeRecords() method
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: api.PressureObserver.takeRecords

URL: /en-US/docs/Web/API/PressureObserver/disconnect
Title: PressureObserver: disconnect() method
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: api.PressureObserver.disconnect

URL: /en-US/docs/Web/API/PressureObserver/PressureObserver
Title: PressureObserver: PressureObserver() constructor
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: api.PressureObserver.PressureObserver

URL: /en-US/docs/Web/HTTP/Headers/Permissions-Policy/compute-pressure
Title: Permissions-Policy: compute-pressure
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: http.headers.Permissions-Policy.compute-pressure
External URLs (4)

URL: /en-US/docs/Web/API/Compute_Pressure_API
Title: Compute Pressure API


URL: /en-US/docs/Web/API/PressureRecord/state
Title: PressureRecord: state property

(comment last updated: 2024-05-13 08:12:57)

Comment thread files/en-us/web/api/compute_pressure_api/index.md Outdated
Comment thread files/en-us/web/api/compute_pressure_api/index.md Outdated
Comment thread files/en-us/web/api/compute_pressure_api/index.md Outdated
Comment thread files/en-us/web/api/compute_pressure_api/index.md Outdated
Comment thread files/en-us/web/api/compute_pressure_api/index.md Outdated
Comment thread files/en-us/web/api/compute_pressure_api/index.md Outdated
Comment thread files/en-us/web/api/compute_pressure_api/index.md Outdated
Comment thread files/en-us/web/api/compute_pressure_api/index.md Outdated
Comment thread files/en-us/web/api/compute_pressure_api/index.md

@tomayac tomayac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just left a couple of comments. Looks pretty good already, thanks for documenting this!

Comment thread files/en-us/web/api/compute_pressure_api/index.md Outdated
Comment thread files/en-us/web/api/compute_pressure_api/index.md Outdated
Comment thread files/en-us/web/api/compute_pressure_api/index.md Outdated
Comment thread files/en-us/web/api/compute_pressure_api/index.md Outdated
Comment thread files/en-us/web/api/pressureobserver/disconnect/index.md

@wbamberg wbamberg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Florian!

Comment thread files/en-us/web/api/compute_pressure_api/index.md Outdated
Comment thread files/en-us/web/api/pressureobserver/pressureobserver/index.md Outdated
Comment thread files/en-us/web/api/pressureobserver/pressureobserver/index.md Outdated
Comment thread files/en-us/web/api/pressureobserver/pressureobserver/index.md Outdated
Comment thread files/en-us/web/api/pressureobserver/pressureobserver/index.md Outdated
Comment thread files/en-us/web/api/pressurerecord/time/index.md Outdated
Comment thread files/en-us/web/api/pressurerecord/time/index.md Outdated
Comment thread files/en-us/web/api/compute_pressure_api/index.md Outdated
Comment thread files/en-us/web/http/headers/permissions-policy/compute-pressure/index.md Outdated
Comment thread files/en-us/web/api/pressurerecord/source/index.md Outdated
@Elchi3

Elchi3 commented Apr 12, 2024

Copy link
Copy Markdown
Member Author

Thanks everyone, I went through all the comments. I think the outstanding questions are:

  • The explainer says that rAF could only be used to mitigate issues (by triggering less frequently) and the Compute Pressure API proactively prevents pressure. How is that meant exactly? (or maybe I should remove this sentence if it doesn't help anyone) comment

  • Will observe() have a promise or not? comment

  • Why can observe() throw a NotAllowedError, wouldn't the constructor throw before anyway? comment

  • What is takeRecords() for? Does anyone have a good example? comment

  • When "cpu" is the source it watches the thread in which this observer is running, right? comment

  • Epoch timestamps will be changed to document/worker creation timestamps in Chromium or what is the status? comment

  • TODOs:

    • need to rename supportedSources to knownSources

@Elchi3
Elchi3 force-pushed the compute-pressure branch from f3bd178 to 83d1aeb Compare May 3, 2024 13:32
@Elchi3

Elchi3 commented May 3, 2024

Copy link
Copy Markdown
Member Author

I've addressed the review feedback and updated the docs per the latest spec change (supportedSources -> knownSources). I've also merged the BCD so that we can have spec and compat sections in the docs.

Marking as ready for final review.

@Elchi3
Elchi3 marked this pull request as ready for review May 3, 2024 13:45
@Elchi3
Elchi3 requested review from a team, bsmth, teoli2003 and wbamberg and removed request for a team May 3, 2024 13:45

@wbamberg wbamberg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates Florian. I had some tiny comments.

Comment thread files/en-us/web/api/pressureobserver/pressureobserver/index.md Outdated
Comment thread files/en-us/web/api/pressureobserver/observe/index.md Outdated
Comment thread files/en-us/web/api/pressureobserver/takerecords/index.md
Co-authored-by: wbamberg <will@bootbonnet.ca>
Comment thread files/en-us/web/api/pressureobserver/takerecords/index.md Outdated
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

@wbamberg wbamberg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thank you Florian!

@wbamberg
wbamberg merged commit a251e34 into mdn:main May 14, 2024
@Elchi3
Elchi3 deleted the compute-pressure branch May 15, 2024 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:HTTP HTTP docs Content:WebAPI Web API docs size/l [PR only] 501-1000 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants