qt: Improve TrafficGraphWidget functionality #865

pull rebroad wants to merge 5 commits into bitcoin-core:master from rebroad:trafficgraphwidget-rebased changing 13 files +727 −126
  1. rebroad commented at 9:53 pm on April 9, 2025: contributor

    This PR includes several improvements to the TrafficGraphWidget:

    1. Enhanced traffic graph visualization with improved scaling and tooltips
    2. Added persistence for traffic data between sessions
    3. Improved time handling with new utility functions
    4. Added support for multiple time ranges with smooth transitions
    5. Updated deprecated Qt5 mouse event methods for Qt6 compatibility

    Key improvements:

    • Added tooltips showing detailed traffic information when hovering over data points
    • Implemented data persistence to maintain traffic history between application restarts
    • Added new utility functions for time formatting and millisecond precision
    • Improved graph scaling with logarithmic option for better visualization of varying traffic levels
    • Updated mouse event handling to use modern Qt6 APIs
    • Added support for multiple time ranges (5min to 28 days) with smooth transitions
    • Improved data accuracy with better timestamp handling

    This is a rebase of #559 for the latest core/master, with significant improvements to the traffic graph widget’s functionality and user experience.

  2. qt: Add formatBytesps function for bytes per second display
    Add a new GUI utility function to format bytes per second values with appropriate
    units (B/s, kB/s, MB/s, GB/s) and precision, ensuring consistent and readable
    display of network traffic rates in the traffic graph widget.
    76bf379ff3
  3. net: Add setTotalBytes functionality for traffic data persistence
    Add functions to set total bytes sent/received counts to enable restoring
    traffic statistics between application sessions. This allows for continuous
    traffic monitoring even after application restarts, improving the usefulness
    of the traffic graph widget.
    f069e6aa22
  4. util: Add FormatISO8601Time function for time-only ISO format
    Add a new time formatting function that matches the existing date and datetime
    ISO8601 formatting functions, providing consistent time display for the
    traffic graph widget tooltips and other UI elements that need time-only display.
    64e298b91f
  5. util: Add GetTimeMillis convenience wrapper for chrono timestamps
    Add a convenience wrapper function for obtaining the current system time
    in milliseconds. This uses the modern std::chrono library internally
    while providing a shorter, more readable interface for code that needs
    millisecond precision timestamps.
    
    This improves code readability in areas like the TrafficGraphWidget that
    work with millisecond timestamps while maintaining compatibility with
    Bitcoin Core's move toward using std::chrono-based time handling.
    24a898dba3
  6. DrahtBot commented at 9:53 pm on April 9, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  7. qt: Enhance TrafficGraphWidget with multi-timeframe support and data persistence
    This commit significantly improves the network traffic graph widget with:
    
    1. Multiple timeframe support - View traffic data across different time
       periods (5 minutes to 28 days) using an enhanced slider interface
    
    2. Traffic data persistence - Save and restore traffic information
       between sessions, preserving historical traffic patterns
    
    3. Interactive visualization features:
       - Logarithmic scale toggle (mouse click) for better visualization of
         varying traffic volumes
       - Interactive tooltips showing detailed traffic information at specific points
       - Yellow highlight indicators for selected data points
    
    4. Smooth transitions between different time ranges with animated scaling
    
    These improvements allow users to better monitor and analyze network
    traffic patterns over time, which is especially useful for debugging
    connectivity issues or understanding network behavior under different
    conditions.
    
    The implementation includes proper thread-safety considerations and
    handles edge cases like time jumps or missing data appropriately.
    10292b3597
  8. rebroad force-pushed on Apr 9, 2025
  9. DrahtBot added the label CI failed on Apr 9, 2025
  10. DrahtBot commented at 10:07 pm on April 9, 2025: contributor

    🚧 At least one of the CI tasks failed. Debug: https://github.com/bitcoin-core/gui/runs/40284363440

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

  11. rebroad closed this on Apr 9, 2025

  12. luke-jr commented at 5:09 am on April 10, 2025: member
    @rebroad FWIW, I’ve been maintaining most of this in Knots if you want to clone them back here.
  13. rebroad commented at 8:11 am on April 10, 2025: contributor

    @rebroad FWIW, I’ve been maintaining most of this in Knots if you want to clone them back here.

    which branch? I just checked knots/28.x-knots but couldn’t see it.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-04-18 18:20 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me