Skip to content

Conversation

@Nyla-Hughes
Copy link
Collaborator

THIS IS CONCEPT OF WHAT SUPPOSED TO HAPPEN NOT FULLY DONE

This is a quick concept of what the packet counter should look like, this includes the counter itself (but its counting clicks until packets are fully implememted) and a timer removes the clicks past 60 seconds. This is be replaced with the full implemnt of the packets rather than clicks once finished. you can try it by clicking the Check TCP Connection Status button and it will add that click to the counter then after 60 seconds itll remove it.

related to #109


What was changed?

Added new code in state.rs to keep track of clicks and remove old ones after 60 seconds.

changed update.rs so the counter refreshes every 10 milliseconds and records clicks when the button is pressed.
Added a new label in view.rs so the number of clicks in the last 60 seconds shows up on the screen.


Why was it changed?

Before, the GUI didn’t show if anything was changing

The new counter gives a simple way to see activity.

Using clicks for now makes it easy to test, and it will later show real packet counts.


How was it changed?

Added a list that remembers the time of each click. And it checks if any clicks in older than 60 seconds and removes them

The number of clicks left in the list is shown on the screen.


Screenshots (if applicable):

This first image is the "packets" but its me clicking 5 times and it shows
Screenshot 2025-09-15 at 3 15 13 PM

This second image is how it looks after 60 seconds have passed, the counter went back to zero
Screenshot 2025-09-15 at 3 16 13 PM

…this includes the counter itself (but its counting clicks until packets are fully implememted) and a timer removes the clicks past 60 seconds. This is be replaced with the full implemnt of the packets rather than clicks once finished. you can try it by clicking the Check TCP Connection Status button and it will add that click to the counter then after 60 seconds itll remove it.
@jthomas39
Copy link
Collaborator

Clearing the list every 60 seconds is a really good addition! It helps with controlling memory usage and reduces the possibility of causing memory leaks. This will help reduce the amount of optimisation that needs to done later down the road! I looked through your code and didn't see any major issues. Hope the rest of the implementation goes well for you!

@Nyla-Hughes Nyla-Hughes force-pushed the feature/Packet-Counter branch 2 times, most recently from 3da5362 to 0e428ee Compare September 22, 2025 18:23
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.

2 participants