ooni-probe-cli/internal/netxlite/errorsx/operations.go
Simone Basso 83440cf110
refactor: split errorsx in good and legacy (#477)
The legacy part for now is internal/errorsx. It will stay there until
I figure out whether it also needs some extra bug fixing.

The good part is now in internal/netxlite/errorsx and contains all the
logic for mapping errors. We need to further improve upon this logic
by writing more thorough integration tests for QUIC.

We also need to copy the various dialer, conn, etc adapters that set
errors. We will put them inside netxlite and we will generate errors in
a way that is less crazy with respect to the major operation. (The
idea is to always wrap, given that now we measure in an incremental way
and we don't measure every operation together.)

Part of https://github.com/ooni/probe/issues/1591
2021-09-07 17:09:30 +02:00

45 lines
1.3 KiB
Go

package errorsx
// Operations that we measure.
const (
// ResolveOperation is the operation where we resolve a domain name.
ResolveOperation = "resolve"
// ConnectOperation is the operation where we do a TCP connect.
ConnectOperation = "connect"
// TLSHandshakeOperation is the TLS handshake.
TLSHandshakeOperation = "tls_handshake"
// QUICHandshakeOperation is the handshake to setup a QUIC connection.
QUICHandshakeOperation = "quic_handshake"
// QUICListenOperation is when we open a listening UDP conn for QUIC.
QUICListenOperation = "quic_listen"
// HTTPRoundTripOperation is the HTTP round trip.
HTTPRoundTripOperation = "http_round_trip"
// CloseOperation is when we close a socket.
CloseOperation = "close"
// ReadOperation is when we read from a socket.
ReadOperation = "read"
// WriteOperation is when we write to a socket.
WriteOperation = "write"
// ReadFromOperation is when we read from an UDP socket.
ReadFromOperation = "read_from"
// WriteToOperation is when we write to an UDP socket.
WriteToOperation = "write_to"
// UnknownOperation is when we cannot determine the operation.
UnknownOperation = "unknown"
// TopLevelOperation is used when the failure happens at top level. This
// happens for example with urlgetter with a cancelled context.
TopLevelOperation = "top_level"
)