Skip to content

Conversation

@jolavillette
Copy link
Contributor

Expose per-peer output queue size in bytes for improved network monitoring and decision making

This PR introduces a mechanism to monitor the actual volume of data (in bytes) waiting in the output queue for each peer. This provides a more accurate view of network congestion than simple item counts, allowing services to make better-informed decisions regarding data throttling.

Files modified:

libretroshare/src/pqi/pqi_base.h: Added mQueueOutBytes to the RsBwRates structure.

libretroshare/src/retroshare/rsconfig.h: Added mQueueOutBytes to RsConfigDataRates to expose the data via the public API.

libretroshare/src/pqi/pqistreamer.cc: Implemented the actual byte-size calculation of pending packets using locked_compute_out_pkt_size().

libretroshare/src/pqi/pqiperson.cc: Updated the statistics relay to pass the new byte metric.

libretroshare/src/pqi/pqihandler.cc: Updated the rate extraction logic to aggregate byte counts across all search modules.

libretroshare/src/services/p3bwctrl.cc: Updated the bandwidth control service to store and provide these values through getTotalBandwidthRates() and getAllBandwidthRates().

As a practical example, this data is used in RsGxsNetService to provide a detailed global and per-peer network status report during synchronization.

libretroshare/src/gxs/rsgxsnetservice.cc: Implemented a shared file-scope cache and a throttled 5-second display logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant