Skip to content

Conversation

@mbobiosio
Copy link

This pull request implements persistent network usage tracking, allowing the extension to remember total data usage between system reboots.

Problem
Previously, the extension would reset the data counter to zero after each reboot because Linux resets system network counters. This made it impossible to track total data usage over extended periods.

Solution

  • Store counter state in a JSON file in the user's home directory (~/.netspeed_data)
  • Implement a robust mechanism to detect system counter resets
  • Add an offset value that persists between sessions
  • Save counter state periodically and during extension disable
  • Clean up code and improve error handling

User Experience
Users can now see their continuously accumulated network usage in Mode 5, even after rebooting their system. The counter will maintain its value between sessions, making it useful for tracking total bandwidth consumption over time.

Testing
Tested across multiple system reboots with various network activity patterns. The counter correctly maintains its value and continues counting from where it left off.

Implement counter persistence to maintain network usage statistics across system reboots.
The extension now properly tracks total network usage even when system counters reset.

- Store counter state in ~/.netspeed_data using JSON format
- Handle system counter resets by maintaining offset value
- Add periodic saving to prevent data loss
- Implement proper cleanup and initialization
- Fix calculation logic for consistent counting
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