ooni / probe

OONI Probe network measurement tool for detecting internet censorship
https://ooni.org/install
BSD 3-Clause "New" or "Revised" License
750 stars 142 forks source link

dslx: Func.Apply should take a Maybe[A] as input #2613

Closed bassosimone closed 8 months ago

bassosimone commented 8 months ago

If we allow functions to take a Maybe[A] as input, we can write inline filters that intercept errors and set the test keys. By making this possible, we would make using dslx to write experiments simpler. Crucially, we would most likely also stop needing to have counters and other hacks to know when/how a stage failed.

To make this change possible, we need to rename FuncAdapter to Operation. We will gradually detach the type of the Operation from that of the original FuncAdapter. The first step would be to avoid forwarding the input from Operation to the real underlying Go func if the Maybe contains an error. Otherwise, we would unwrap and forward the state.

The overall objective here is to cleanup and review dslx, then start using it in production and rewrite experiments using it. In turn, by doing that, we'll enable collecting better throttling metrics for experiments.