Skip to content

Change sampleRate to sampleInterval #254

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

Merged
merged 4 commits into from
Mar 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix comments from Raphael
  • Loading branch information
kenchris committed Mar 19, 2024
commit f469c0a462f1912f284407465e9d20f5f9cd23e3
42 changes: 25 additions & 17 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,36 +197,44 @@

Supported sources

Sampling and Reporting Rate

The requested sampling interval represents the desired
interval between samples, expressed in milliseconds.

The [=requested sampling interval=] can also be expressed as the
requested sampling rate in Hertz (cycles per second) by
dividing 1000 with the [=requested sampling interval=] value.

The sampling rate for a [=platform collector=] is defined as a rate
at which the [=user agent=] obtains telemetry readings from the underlying platform
in Hertz (cycles per second), and it might differ from the rate derived from the
pressure observers' [=requested sample interval=] (in milliseconds) by dividing
1000 with the value.
at which the [=user agent=] obtains telemetry readings from the underlying platform,
and it might differ from the pressure observers' [=requested sampling rates=].
The rate is measured in Hertz (cycles per second).

The reporting rate for a pressure observer is the rate at which it runs
the [=data delivery=] steps.
the [=data delivery=] steps, and it will never exceed the [=sampling rate=].

The [=sampling rate=] differs from the [=requested sample interval=] derived rate,
when it exceeds upper or lower sampling rate bounds
The [=sampling rate=] differs from the [=requested sampling rate=] when the
[=requested sampling rate=] exceeds upper or lower sampling rate bounds
supported or accepted by the underlying platform and [=user agent=].

It is recommended that the [=user agent=] limits the [=reporting rate=]
as outlined in [[[#rate-limiting-change-notifications]]].

In case the user didn't request a sample interval, the [=sampling rate=]
In case the user didn't request a [=sampling rate=], the [=sampling rate=]
is [=implementation-defined=].

In case there are multiple instances of {{PressureObserver}} active with different
[=requested sample intervals=], it is up to the [=user agent=] to set a
[=requested sampling intervals=], it is up to the [=user agent=] to set a
[=platform collector=] level [=sampling rate=] that best fulfills these requests,
while making sure that the [=reporting rate=] of all {{PressureObserver}}s does
not exceed their respective [=requested sample intervals=].
not exceed their respective [=requested sampling rates=].
Expand Down Expand Up @@ -368,7 +376,7 @@

a [[\Callback]] of type {{PressureUpdateCallback}} set on creation.
  • a [[\SampleInterval]] unsigned long long set on creation.
    a [[\SampleInterval]] unsigned long set on creation.
  • a [[\PendingObservePromises]] [=list=] of zero or more source-promise [=tuples=], initially empty,
    Expand Down Expand Up @@ -810,20 +818,20 @@

    The toJSON member

    The PressureObserverOptions dictionary

    dictionary PressureObserverOptions {
    [EnforceRange] unsigned long long sampleInterval = 0;
    [EnforceRange] unsigned long sampleInterval = 0;
    };

    The sampleInterval member

    The {{PressureObserverOptions/sampleInterval}} member represents the requested sample
    interval expressed in milliseconds, ie. it represents the requested interval between samples
    The {{PressureObserverOptions/sampleInterval}} member represents the [=requested sampling
    interval=] 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=].
    is obtained by dividing 1000 by the [=requested sampling interval=].

    A [=user agent=] might not be able to respect the requested sample interval. For more information
    A [=user agent=] might not be able to respect the requested sampling interval. For more information
    consult [[[#sampling-and-reporting-rate]]].

    Expand Down Expand Up @@ -1017,7 +1025,7 @@

    Supporting algorithms

    As there might be multiple observers, each with a different [=requested sample interval=], the underlying
    As there might be multiple observers, each with a different [=requested sampling rate=], the underlying
    [=platform collector=] will need to use a [=sampling rate=] that fulfills all these requirements. This also
    means that not every data sample from the [=platform collector=] needs to be delivered to each active
    observer.
    Expand Down