Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Compute Pressure API #32923

Merged
merged 13 commits into from
May 14, 2024
Merged

Document Compute Pressure API #32923

merged 13 commits into from
May 14, 2024

Conversation

Elchi3
Copy link
Member

@Elchi3 Elchi3 commented Apr 2, 2024

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
Copy link
Contributor

github-actions bot commented Apr 2, 2024

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)

Copy link
Contributor

@tomayac tomayac left a comment

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!

files/en-us/web/api/compute_pressure_api/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/compute_pressure_api/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/compute_pressure_api/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/compute_pressure_api/index.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

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

Thanks Florian!

files/en-us/web/api/compute_pressure_api/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/pressurerecord/time/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/pressurerecord/time/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/compute_pressure_api/index.md Outdated Show resolved Hide resolved
@Elchi3
Copy link
Member Author

Elchi3 commented Apr 12, 2024

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
Copy link
Member Author

Elchi3 commented May 3, 2024

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 as code owners May 3, 2024 13:45
@Elchi3 Elchi3 requested review from wbamberg, teoli2003 and bsmth and removed request for a team May 3, 2024 13:45
Copy link
Collaborator

@wbamberg wbamberg left a comment

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.

Co-authored-by: wbamberg <will@bootbonnet.ca>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Collaborator

@wbamberg wbamberg left a comment

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
9 checks passed
@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