compute-pressure icon indicating copy to clipboard operation
compute-pressure copied to clipboard

Allow an array of sources

Open tomayac opened this issue 2 years ago • 1 comments

  • Current: observer.observe('thing').
  • Proposal: observer.observe({things: ['thing1', 'thing2']}) (names to be bike-shed).

Similar to PerformanceObserver's entryTpes option.

tomayac avatar May 26 '23 13:05 tomayac

It seems that using PressureSource is a good/futureproof design. Currently it supports "cpu" and "thermals", but I guess it might support in the future "memory", "io" ("bus", "network"), "gpu", "psi" etc.

These sources might be independent or not, depending on the situation.

There is a question whether do we want to add sources with sequential API calls, in order to catch specific errors (which on the other hand might be a fingerprinting opportunity), - or to specify a list of sources with one call as suggested above, and control the order of adding the sources by the spec algorithm (or by a policy hint from the user). IMHO the API shape is mainly influenced by what errors we want to capture, when and how.

zolkis avatar May 31 '23 13:05 zolkis