-
Notifications
You must be signed in to change notification settings - Fork 10
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
Conversation
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=]. |
There was a problem hiding this comment.
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 ..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but you "divide by" something: https://dictionary.cambridge.org/dictionary/english/divide-by
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 :)
title: %s/samplerate/sampleRate/ |
LGTM, but I believe another reviewer is as least needed. |
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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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}}. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Outdated
The rate is measured in Hertz (cycles per second). | ||
</p> | ||
<p> | ||
The [=requested sampling rate=] can be derived from the [=requested sample interval=] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed now
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)?There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK check now!
Integrate Raphael's changes Co-authored-by: Raphael Kubo da Costa <[email protected]>
There was a problem hiding this 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!
Co-authored-by: Raphael Kubo da Costa <[email protected]>
Thank you sorting this out, @kenchris! |
Following specifications change [1], sampleRate in hertz is changed to sampleInterval in millisecond. w3c/compute-pressure#254 Bug: 330376756 Change-Id: Ibe909d537e462cd251d28c7d4d4702341dc33c0c
Following specifications change [1], sampleRate in hertz is changed to sampleInterval in millisecond. w3c/compute-pressure#254 Bug: 330376756 Change-Id: Ibe909d537e462cd251d28c7d4d4702341dc33c0c
Following specifications change [1], sampleRate in hertz is changed to sampleInterval in millisecond. w3c/compute-pressure#254 Bug: 330376756 Change-Id: Ibe909d537e462cd251d28c7d4d4702341dc33c0c
Following specifications change [1], sampleRate in hertz is changed to sampleInterval in millisecond. w3c/compute-pressure#254 Bug: 330376756 Change-Id: Ibe909d537e462cd251d28c7d4d4702341dc33c0c
Following specifications change[1], sampleRate in hertz is changed to sampleInterval in millisecond. [1]:w3c/compute-pressure#254 Bug: 330376756 Change-Id: Ibe909d537e462cd251d28c7d4d4702341dc33c0c
After the change w3c#254, documentations in this repository need update.
Following specifications change [1], sampleRate in hertz is changed to sampleInterval in millisecond. w3c/compute-pressure#254 Bug: 330376756 Change-Id: Ibe909d537e462cd251d28c7d4d4702341dc33c0c
Following specifications change[1], sampleRate in hertz is changed to sampleInterval in millisecond. w3c/compute-pressure#254 Bug: 330376756 Change-Id: Ibe909d537e462cd251d28c7d4d4702341dc33c0c
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 <[email protected]> Reviewed-by: Raphael Kubo Da Costa <[email protected]> Commit-Queue: Arnaud Mandy <[email protected]> Cr-Commit-Position: refs/heads/main@{#1275582}
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 <[email protected]> Reviewed-by: Raphael Kubo Da Costa <[email protected]> Commit-Queue: Arnaud Mandy <[email protected]> Cr-Commit-Position: refs/heads/main@{#1275582}
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 <[email protected]> Reviewed-by: Raphael Kubo Da Costa <[email protected]> Commit-Queue: Arnaud Mandy <[email protected]> Cr-Commit-Position: refs/heads/main@{#1275582}
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 <[email protected]> Reviewed-by: Raphael Kubo Da Costa <[email protected]> Commit-Queue: Arnaud Mandy <[email protected]> Cr-Commit-Position: refs/heads/main@{#1275582} Co-authored-by: Arnaud Mandy <[email protected]>
After the change #254, documentations in this repository need update.
…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 <[email protected]> Reviewed-by: Raphael Kubo Da Costa <[email protected]> Commit-Queue: Arnaud Mandy <[email protected]> Cr-Commit-Position: refs/heads/main@{#1275582} Co-authored-by: Arnaud Mandy <[email protected]>
…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 <[email protected]> Reviewed-by: Raphael Kubo Da Costa <[email protected]> Commit-Queue: Arnaud Mandy <[email protected]> Cr-Commit-Position: refs/heads/main@{#1275582} Co-authored-by: Arnaud Mandy <[email protected]> -- wpt-commits: 6ec99e59d4f549f28e838ec04e0aaeac43488ed1 wpt-pr: 45213
…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 <[email protected]> Reviewed-by: Raphael Kubo Da Costa <[email protected]> Commit-Queue: Arnaud Mandy <[email protected]> Cr-Commit-Position: refs/heads/main@{#1275582} Co-authored-by: Arnaud Mandy <[email protected]> -- wpt-commits: 6ec99e59d4f549f28e838ec04e0aaeac43488ed1 wpt-pr: 45213
Based on Origin Trial feedback pointed out during intent to ship
Closes #253
@rakuco @foolip
Preview | Diff