eqlabs / pathfinder

A Starknet full node written in Rust
https://eqlabs.github.io/pathfinder/
Other
619 stars 227 forks source link

feat(p2p): tracing for sync stages #2052

Closed Mirko-von-Leipzig closed 3 months ago

Mirko-von-Leipzig commented 3 months ago

This PR adds tracing to the P2P sync stages.

Example trace looks something like this

DEBUG stage=Headers::Verify, input_queue=50%, (50/100), throughput=1234, Item processed

It displays the assigned stage name, the input queue fullness (both in percentage and actual amount) and the instantaneous throughput this iteration was processed at.

Things I'm on the fence about

Its also unclear to me which metrics would be useful here. Probably both queue fullness and throughput would be something we want to measure. However, for metrics the consumer can also compute the averages if they want.

Also note that this throughput isn't measuring over the wait time for sending and receiving as blocking here could lead to misleading values.