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

Change sampleRate to sampleInterval #254

Merged
merged 4 commits into from Mar 19, 2024
Merged

Change sampleRate to sampleInterval #254

merged 4 commits into from Mar 19, 2024

Conversation

kenchris
Copy link
Contributor

@kenchris kenchris commented Mar 18, 2024

Based on Origin Trial feedback pointed out during intent to ship

Closes #253

@rakuco @foolip


Preview | Diff

index.html Outdated
The {{PressureObserverOptions/sampleInterval}} member represents the <dfn>requested sample
interval</dfn> expressed in milliseconds, ie. it represents the requested interval between samples
to be obtained from the hardware. The [=reporting rate=] will never exceed the sampling rate which
is obtained by dividing 1000 by the [=requested sample interval=].
Copy link
Contributor

@arskama arskama Mar 18, 2024

Choose a reason for hiding this comment

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

" The [=reporting rate=] will never exceed the sampling rate which is obtained by dividing 1000 by the [=requested sample interval=]."

I think there is a wrong order of words or too many "by" in the "by dividing 1000 by ..."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me ask a native english speaker

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Native speaker said "looks good to me, like literally spot on" - so I guess we are fine :)

@arskama
Copy link
Contributor

arskama commented Mar 19, 2024

title: %s/samplerate/sampleRate/

@kenchris kenchris changed the title Change samplerate to sampleInterval Change sampleRate to sampleInterval Mar 19, 2024
@arskama
Copy link
Contributor

arskama commented Mar 19, 2024

LGTM, but I believe another reviewer is as least needed.

@kenchris
Copy link
Contributor Author

I am wondering whether minInterval would be a better name?

index.html Outdated
@@ -811,25 +810,20 @@ <h3>The <dfn>toJSON</dfn> member</h3>
<h3>The <dfn>PressureObserverOptions</dfn> dictionary</h3>
<pre class="idl">
dictionary PressureObserverOptions {
double sampleRate = 1.0;
[EnforceRange] unsigned long long sampleInterval = 0;
Copy link
Member

Choose a reason for hiding this comment

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

I think an unsigned long is enough here. 4294967295 (its maximum value) corresponds to something like 1190 hours.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was mostly done for consistency with the brackground sync spec

@@ -531,10 +533,7 @@ <h3>The <dfn>constructor()</dfn> method</h3>
Set |this|.{{PressureObserver/[[Callback]]}} to |callback:PressureUpdateCallback|.
</li>
<li>
If |options|["sampleRate"] is less than or equal to 0, throw a {{RangeError}}.
Copy link
Member

Choose a reason for hiding this comment

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

0 is a valid value for unsigned long and unsigned long long. If is allowed here, it means users can make the "passes rate test" check always return true. It's not exactly wrong, so it's more like what you'd like to communicate here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is a bit weird that it becomes a RangeError, so I more consider it the fastest frequency possible, which the implementation can limit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Basically 0 means, give me events as soon/fast as possible

index.html Show resolved Hide resolved
index.html Outdated
The rate is measured in Hertz (cycles per second).
</p>
<p>
The [=requested sampling rate=] can be derived from the [=requested sample interval=]
Copy link
Member

Choose a reason for hiding this comment

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

"requested sampling rate" was <dfn>ed in PressureObserverOptions, now it's not defined anywhere.

My suggestion was to move the "requested sampling interval"'s <dfn> to this section and also <dfn> "requested sampling rate" here, and explain how they are basically the same thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be fixed now

Copy link
Member

Choose a reason for hiding this comment

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

I still think the current <dfn> for "requested sample interval" that is currently in PressureObserverOptions should be moved to this section, so that you group all related concepts in one place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am trying to follow you, so you don't want the dfn in the

The sampleInterval member

section as it is now (and the old one previously was)?

Copy link
Member

Choose a reason for hiding this comment

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

Correct. IMO it makes more sense to put the <dfn>s for both "requested sampling rate/interval" in the "Sampling and Reporting Rate" section, so that both concepts are defined next to each other. The "sampleInterval member" section then just references the concept you defined in the "Concepts" section.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK check now!

index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
Integrate Raphael's changes

Co-authored-by: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Copy link
Member

@rakuco rakuco left a comment

Choose a reason for hiding this comment

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

lgtm with a nit!

index.html Outdated Show resolved Hide resolved
Co-authored-by: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
@kenchris kenchris merged commit 3f35f03 into w3c:main Mar 19, 2024
2 checks passed
@foolip
Copy link
Member

foolip commented Mar 19, 2024

Thank you sorting this out, @kenchris!

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 20, 2024
Following specifications change [1], sampleRate in hertz is changed to
sampleInterval in millisecond.

w3c/compute-pressure#254

Bug: 330376756
Change-Id: Ibe909d537e462cd251d28c7d4d4702341dc33c0c
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 20, 2024
Following specifications change [1], sampleRate in hertz is changed to
sampleInterval in millisecond.

w3c/compute-pressure#254

Bug: 330376756
Change-Id: Ibe909d537e462cd251d28c7d4d4702341dc33c0c
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 20, 2024
Following specifications change [1], sampleRate in hertz is changed to
sampleInterval in millisecond.

w3c/compute-pressure#254

Bug: 330376756
Change-Id: Ibe909d537e462cd251d28c7d4d4702341dc33c0c
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 20, 2024
Following specifications change [1], sampleRate in hertz is changed to
sampleInterval in millisecond.

w3c/compute-pressure#254

Bug: 330376756
Change-Id: Ibe909d537e462cd251d28c7d4d4702341dc33c0c
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 20, 2024
Following specifications change[1], sampleRate in hertz is changed to
sampleInterval in millisecond.

[1]:w3c/compute-pressure#254

Bug: 330376756
Change-Id: Ibe909d537e462cd251d28c7d4d4702341dc33c0c
arskama added a commit to arskama/compute-pressure that referenced this pull request Mar 20, 2024
After the change w3c#254, documentations in this repository need update.
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 20, 2024
Following specifications change [1], sampleRate in hertz is changed to
sampleInterval in millisecond.

w3c/compute-pressure#254

Bug: 330376756
Change-Id: Ibe909d537e462cd251d28c7d4d4702341dc33c0c
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 20, 2024
Following specifications change[1], sampleRate in hertz is changed to
sampleInterval in millisecond.

w3c/compute-pressure#254

Bug: 330376756
Change-Id: Ibe909d537e462cd251d28c7d4d4702341dc33c0c
aarongable pushed a commit to chromium/chromium that referenced this pull request Mar 20, 2024
Following specifications change[1], sampleRate in hertz is changed to
sampleInterval in millisecond.

w3c/compute-pressure#254

Bug: 330376756
Change-Id: Ibe909d537e462cd251d28c7d4d4702341dc33c0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5381598
Reviewed-by: Fr <beaufort.francois@gmail.com>
Reviewed-by: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Arnaud Mandy <arnaud.mandy@intel.com>
Cr-Commit-Position: refs/heads/main@{#1275582}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 20, 2024
Following specifications change[1], sampleRate in hertz is changed to
sampleInterval in millisecond.

w3c/compute-pressure#254

Bug: 330376756
Change-Id: Ibe909d537e462cd251d28c7d4d4702341dc33c0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5381598
Reviewed-by: Fr <beaufort.francois@gmail.com>
Reviewed-by: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Arnaud Mandy <arnaud.mandy@intel.com>
Cr-Commit-Position: refs/heads/main@{#1275582}
jonathan-j-lee pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 20, 2024
Following specifications change[1], sampleRate in hertz is changed to
sampleInterval in millisecond.

w3c/compute-pressure#254

Bug: 330376756
Change-Id: Ibe909d537e462cd251d28c7d4d4702341dc33c0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5381598
Reviewed-by: Fr <beaufort.francois@gmail.com>
Reviewed-by: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Arnaud Mandy <arnaud.mandy@intel.com>
Cr-Commit-Position: refs/heads/main@{#1275582}
jonathan-j-lee pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 20, 2024
Following specifications change[1], sampleRate in hertz is changed to
sampleInterval in millisecond.

w3c/compute-pressure#254

Bug: 330376756
Change-Id: Ibe909d537e462cd251d28c7d4d4702341dc33c0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5381598
Reviewed-by: Fr <beaufort.francois@gmail.com>
Reviewed-by: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Arnaud Mandy <arnaud.mandy@intel.com>
Cr-Commit-Position: refs/heads/main@{#1275582}

Co-authored-by: Arnaud Mandy <arnaud.mandy@intel.com>
arskama added a commit that referenced this pull request Mar 21, 2024
After the change #254, documentations in this repository need update.
BruceDai pushed a commit to BruceDai/wpt that referenced this pull request Mar 25, 2024
…sts#45213)

Following specifications change[1], sampleRate in hertz is changed to
sampleInterval in millisecond.

w3c/compute-pressure#254

Bug: 330376756
Change-Id: Ibe909d537e462cd251d28c7d4d4702341dc33c0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5381598
Reviewed-by: Fr <beaufort.francois@gmail.com>
Reviewed-by: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Arnaud Mandy <arnaud.mandy@intel.com>
Cr-Commit-Position: refs/heads/main@{#1275582}

Co-authored-by: Arnaud Mandy <arnaud.mandy@intel.com>
ErichDonGubler pushed a commit to ErichDonGubler/firefox that referenced this pull request Mar 25, 2024
…mpleInterval, a=testonly

Automatic update from web-platform-tests
ComputePressure: Turn sampleRate into sampleInterval (#45213)

Following specifications change[1], sampleRate in hertz is changed to
sampleInterval in millisecond.

w3c/compute-pressure#254

Bug: 330376756
Change-Id: Ibe909d537e462cd251d28c7d4d4702341dc33c0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5381598
Reviewed-by: Fr <beaufort.francois@gmail.com>
Reviewed-by: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Arnaud Mandy <arnaud.mandy@intel.com>
Cr-Commit-Position: refs/heads/main@{#1275582}

Co-authored-by: Arnaud Mandy <arnaud.mandy@intel.com>
--

wpt-commits: 6ec99e59d4f549f28e838ec04e0aaeac43488ed1
wpt-pr: 45213
ChunMinChang pushed a commit to ChunMinChang/gecko-dev that referenced this pull request Mar 25, 2024
…mpleInterval, a=testonly

Automatic update from web-platform-tests
ComputePressure: Turn sampleRate into sampleInterval (#45213)

Following specifications change[1], sampleRate in hertz is changed to
sampleInterval in millisecond.

w3c/compute-pressure#254

Bug: 330376756
Change-Id: Ibe909d537e462cd251d28c7d4d4702341dc33c0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5381598
Reviewed-by: Fr <beaufort.francois@gmail.com>
Reviewed-by: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Arnaud Mandy <arnaud.mandy@intel.com>
Cr-Commit-Position: refs/heads/main@{#1275582}

Co-authored-by: Arnaud Mandy <arnaud.mandy@intel.com>
--

wpt-commits: 6ec99e59d4f549f28e838ec04e0aaeac43488ed1
wpt-pr: 45213
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.

Sampling interval instead of sampling rate
4 participants