Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

router statistics - sort tunnels by traffic (libr) #108

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RetroPooh
Copy link
Contributor

No description provided.

@defnax
Copy link
Contributor

defnax commented Jul 18, 2023

@csoler

@@ -1308,6 +1308,7 @@ void p3turtle::routeGenericTunnelItem(RsTurtleGenericTunnelItem *item)
tunnel.time_stamp = time(NULL) ;

tunnel.transfered_bytes += RsTurtleSerialiser().size(item);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use an intermediate variable here, to avoid calling size() twice. It takes some extra CPU for some items and the present function is called quite a lot.

@@ -188,6 +188,7 @@ class TurtleTunnel
TurtlePeerId local_dst ; // where packets should go. Direction to the destination.
uint32_t time_stamp ; // last time the tunnel was actually used. Used for cleaning old tunnels.
uint32_t transfered_bytes ; // total bytes transferred in this tunnel.
uint64_t total_bytes ;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment here telling what total_bytes means. Indeed, just above, the transfered_bytes variable seems to do exactly the same thing if the name is correct.

@csoler
Copy link
Contributor

csoler commented Jul 18, 2023

It seems to me that this variable "total_bytes" you added does exactly the same job than transfered_bytes. It's really unclear why you added it.

@defnax
Copy link
Contributor

defnax commented Jul 18, 2023

i see difference transfered_bytes only shows the speed and total_bytes gets printed when im right

float speed_estimate = tunnel.transfered_bytes / float(TUNNEL_SPEED_ESTIMATE_LAPSE) ; tunnel.speed_Bps = 0.75*tunnel.speed_Bps + 0.25*speed_estimate ; tunnel.transfered_bytes = 0 ;

tunnel.push_back(printNumber(it->second.total_bytes)) ;

@defnax
Copy link
Contributor

defnax commented Nov 16, 2023

any news? update this pr

@defnax
Copy link
Contributor

defnax commented Nov 16, 2023

@RetroPooh

@defnax
Copy link
Contributor

defnax commented Dec 7, 2023

@RetroPooh can you update your pr

@defnax
Copy link
Contributor

defnax commented Feb 7, 2024

what abiut this? we need this feature

@defnax
Copy link
Contributor

defnax commented Feb 7, 2024

i see no issue there when its merge we has more stats

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.

3 participants