ooni-probe-cli/internal/measurex
Simone Basso 0a630c1716
refactor(measurex): allow to configure timeouts and max-snapshot-size (#645)
This diff lightly refactors the code in measurex to allow a user
to configure all possible timeouts and the max-snapshot-size.

There is currently a little bit of tension between setting timeouts
inside of measurex and the watchdog timeouts inside of netxlite.

This tension has been documented.

Let us repeat the issue also in this commit message. If you are
using a masurex.Measurer configured with very large timeouts and
the underlying netxlite implementation uses shorter whatchdog
timeouts, then you are going to see shorter than expected timeouts.

Ideally, we would like to have just a single timeout but there is
no way to ask the context "hey, can you tell me if you already have
a configured timeout?".

It may be that the right solution is to modify netxlite to have
some sort of root/library object with this configuration.

If that's the case, then a Measurer could be refactored as follows:

- create the underlying netxlite "library"

- initialize the timeouts desired by the Measurer

- create a Dialer, of whatever is needed

- use it

Now this is not possible because netxlite timeouts are internal
static settings rather than attributes of a structure.

Anyway, for now I'm happy with this just being documented.

(I suspect this issue will need to be addresses when we'll write
unit tests for measurex; at that time a proper solution should
come out naturally due to the unit tests constraints.)

I'm working on this refactoring, BTW, to facilitate rewriting `tor`
using measurex (see https://github.com/ooni/probe/issues/1688).
2022-01-04 13:20:48 +01:00
..
archival.go fix(measurex): handle case where TH is nil (#610) 2021-11-22 20:16:38 +01:00
db.go fix(measurex): use same keys of the OONI data format (#572) 2021-11-05 10:46:45 +01:00
dialer.go refactor: interfaces and data types into the model package (#642) 2022-01-03 13:53:23 +01:00
dnsx.go refactor: interfaces and data types into the model package (#642) 2022-01-03 13:53:23 +01:00
doc.go feat(measurex): refactored measurement library (#528) 2021-09-30 01:24:08 +02:00
endpoint.go feat(measurex): refactored measurement library (#528) 2021-09-30 01:24:08 +02:00
failure.go fix(measurex): use same keys of the OONI data format (#572) 2021-11-05 10:46:45 +01:00
http.go refactor(measurex): allow to configure timeouts and max-snapshot-size (#645) 2022-01-04 13:20:48 +01:00
logger.go refactor: interfaces and data types into the model package (#642) 2022-01-03 13:53:23 +01:00
measurement.go fix(measurex): handle case where TH is nil (#610) 2021-11-22 20:16:38 +01:00
measurer.go refactor(measurex): allow to configure timeouts and max-snapshot-size (#645) 2022-01-04 13:20:48 +01:00
oddity.go feat(measurex): refactored measurement library (#528) 2021-09-30 01:24:08 +02:00
quic.go refactor: interfaces and data types into the model package (#642) 2022-01-03 13:53:23 +01:00
resolver.go refactor: interfaces and data types into the model package (#642) 2022-01-03 13:53:23 +01:00
tls.go refactor: interfaces and data types into the model package (#642) 2022-01-03 13:53:23 +01:00
tracing.go refactor(measurex): allow to configure timeouts and max-snapshot-size (#645) 2022-01-04 13:20:48 +01:00
utils.go feat(measurex): refactored measurement library (#528) 2021-09-30 01:24:08 +02:00