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

Consider adding averages #116

Open
kenchris opened this issue Jun 22, 2022 · 0 comments
Open

Consider adding averages #116

kenchris opened this issue Jun 22, 2022 · 0 comments
Labels
dx-improvement Suggestions to improve the Developer Experience, e.g. API improvements

Comments

@kenchris
Copy link
Contributor

kenchris commented Jun 22, 2022

https://www.kernel.org/doc/html/latest/accounting/psi.html makes the point that if you poll slower than 1 second, it makes more sense to look at averages over a time period (say 10s, 1m, 5m) as yo might be looking at a temporary spike.

This also makes sense as we express the sample-rate in hertz. We should in that case make throw when value is less than 1hz and limit the values to what the system supports.

We could expose the averages as part of PressureRecord and rename state to current and then add average10 etc. current could be undefined if samplerate was not set.

dictionary {
  PressureSource source;
  PressureState? current;
  PressureState average10;
  PressureState average60;
  PressureState average300;
  sequence<PressureFactor> contributingFactors;
  DOMHighResTimeStamp time;
};
@kenchris kenchris added the dx-improvement Suggestions to improve the Developer Experience, e.g. API improvements label Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dx-improvement Suggestions to improve the Developer Experience, e.g. API improvements
Projects
None yet
Development

No branches or pull requests

1 participant