[compute-pressure] Sampling interval instead of sampling rate (#253)

foolip has just created a new issue for https://github.com/w3c/compute-pressure:

== Sampling interval instead of sampling rate ==
In https://groups.google.com/a/chromium.org/g/blink-dev/c/7leKysvPZWk/m/WyFKLqwRAQAJ this aggregated feedback from the Chrome origin trial was provided:

> 7% of the respondents mentioned that they would prefer to give the callback frequency in time units (secs, milliseconds), similar to other APIs such as setInterval in place of Hz as currently designed. A number scale along with labels would be more useful e.g. { pressure: 2, label: 'nominal' }.

The first of those is about https://w3c.github.io/compute-pressure/#the-pressureobserveroptions-dictionary, `sampleRate`.

In a look for "frequency", "interval" and "samplerate" in https://github.com/w3c/webref/tree/main/ed/idl I find the following precedent in favor of using a milliseconds interval:

- Good old `setInterval` using milliseconds
- `sampleInterval` in https://wicg.github.io/js-self-profiling/, in milliseconds
- `minInterval` in https://wicg.github.io/periodic-background-sync/, in milliseconds

https://w3c.github.io/sensors/ uses a `frequency` in Hz for how often a sensor should update.

All existing cases of `sampleRate` on the web platform have to do with audio or video, most of it audio.

I hope that helps make a decision on whether to make a change or not.

Please view or discuss this issue at https://github.com/w3c/compute-pressure/issues/253 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 14 March 2024 22:48:30 UTC