Skip to content

State management #4

@jesteria

Description

@jesteria

Some measurement modules might require some form of state to be preserved across iterations.

(For example, speed tests might track their consumed bandwidth to avoid over-consumption.)

Questions:

  • How should this be stored by the framework?
    ➞ Most simply – serialized at {venv prefix} or {user prefix} or /var/lib/netrics + /state/{measurement} – or something; but, unclear what's best.
  • How should this be provided to modules?
    ➞ Could simply provide above path to measurement process via its environ (NETRICS_STATE) and let measurement go for it
    ➞ Could in same manner provide path to a FIFO into which state data has been written, and from which framework will update state, (moderating access to actual state file/whatever).
  • What about shared state? Needed? Allowable?
    ➞ If needed, but with moderation, could make global state available but read-only. (In this case, if implemented as above, would perhaps need either FIFO or better just a PIPE [os.pipe] – framework can provide the read descriptor of the pipe to the measurement, containing the aggregate state.)
    (This might say allow multiple separate measurements which care about bandwidth consumption to each record their own in a consistent manner and abide by the total they aggregate from shared state.)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions