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

Add Compute Pressure API #771

Merged
merged 2 commits into from
Apr 9, 2024
Merged

Conversation

Elchi3
Copy link
Collaborator

@Elchi3 Elchi3 commented Apr 2, 2024

Compat features are tagged in BCD: mdn/browser-compat-data#22687

Not sure if https://chromestatus.com/metrics/feature/timeline/popularity/3900 (PressureObserver_Observe) is the best use counter, cc @kenchris

@foolip
Copy link
Collaborator

foolip commented Apr 2, 2024

Not sure if https://chromestatus.com/metrics/feature/timeline/popularity/3900 (PressureObserver_Observe) is the best use counter

The other alternative is https://chromestatus.com/metrics/feature/timeline/popularity/3899 (the constructor) but so far they show the same data. A call to observe() is more "real", but you can go one step further and say we should measure when the callback is actually invoked.

So I would say use the constructor until we see some difference between that and observe().

@foolip
Copy link
Collaborator

foolip commented Apr 2, 2024

https://w3c.github.io/compute-pressure/#supported-sources has both "thermals" and "cpu", but only "cpu" is implemented in Chrome. So we should probably consider just CPU pressure the initial feature.

Copy link
Collaborator

@foolip foolip left a comment

Choose a reason for hiding this comment

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

Paging @ddbeck for an opinion on naming. Go with the spec name or match the API name? We already have intersection observer.

feature-group-definitions/compute-pressure.yml Outdated Show resolved Hide resolved
feature-group-definitions/compute-pressure.yml Outdated Show resolved Hide resolved
Copy link
Collaborator

@ddbeck ddbeck left a comment

Choose a reason for hiding this comment

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

I looked into this feature a little more. Especially these docs https://developer.chrome.com/docs/web-platform/compute-pressure and this piece in particular:

In this example the "cpu" is the pressure source we are interested in. For now, it is the only
source available. In the future, there may be other sources such as "gpu", "power" or "thermals".

I think what we have here is both generic (the compute pressure API in general) and quite specific (observing CPU pressure specifically). It makes naming and describing this thing a pain. I'm going to review with the understanding that we might get this wrong and need to re-name or describe this later, when its in front of web developers.

feature-group-definitions/compute-pressure.yml Outdated Show resolved Hide resolved
feature-group-definitions/compute-pressure.yml Outdated Show resolved Hide resolved
Co-authored-by: Daniel D. Beck <[email protected]>
Co-authored-by: Philip Jägenstedt <[email protected]>
@foolip foolip merged commit f4d1080 into web-platform-dx:main Apr 9, 2024
2 checks passed
@Elchi3 Elchi3 deleted the compute-pressure branch April 10, 2024 10:59
@ddbeck ddbeck added the feature definition Creating or defining new features or groups of features. label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature definition Creating or defining new features or groups of features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants