Description
I am looking for a way to collect aggregate metrics for each stream/substream at the transport level. I think the best way to do this is to create a connection upgrade that just passes buffers through while also sending tuples of timestamp, direction (e.g. in or out), and buffer size over a user-provided bounded channel. I think this would allow upgrading of arbitrary/all streams/sub-streams with each upgraded connection sending their measurements over a bounded mpsc channel to logic that then calculates the aggregate metrics over time.
Motivation
Currently it is not simple/possible to collect metrics for all/some of the network activity at the transport level--below any protocols. These metrics are useful for analytics and debugging as well as nifty "stats for geeks" displays in rust-libp2p applications.
Requirements
- Upgrade a connection to add measuring the in/out bytes passing through it.
- Report the timestamped and annotated measurements over an mpsc channel if one has been supplied.
- Examples for upgrading single connections and all connections along with an example behavior that consumes the metrics and emits behavior events with aggregate metrics based on the config.
- Maybe the example network behavior speaks a protocol that allows for the aggregate metrics to be sent over the network to another peer.
Open questions
- Is a connection upgrade the correct/best way to do this?
- Is the consumption of the measurements and the generation of aggregate metrics best done in a network behavior?
Are you planning to do it yourself in a pull request?
Maybe
Description
I am looking for a way to collect aggregate metrics for each stream/substream at the transport level. I think the best way to do this is to create a connection upgrade that just passes buffers through while also sending tuples of timestamp, direction (e.g. in or out), and buffer size over a user-provided bounded channel. I think this would allow upgrading of arbitrary/all streams/sub-streams with each upgraded connection sending their measurements over a bounded mpsc channel to logic that then calculates the aggregate metrics over time.
Motivation
Currently it is not simple/possible to collect metrics for all/some of the network activity at the transport level--below any protocols. These metrics are useful for analytics and debugging as well as nifty "stats for geeks" displays in rust-libp2p applications.
Requirements
Open questions
Are you planning to do it yourself in a pull request?
Maybe