-
Notifications
You must be signed in to change notification settings - Fork 29
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
base: master
Are you sure you want to change the base?
Conversation
@@ -1308,6 +1308,7 @@ void p3turtle::routeGenericTunnelItem(RsTurtleGenericTunnelItem *item) | |||
tunnel.time_stamp = time(NULL) ; | |||
|
|||
tunnel.transfered_bytes += RsTurtleSerialiser().size(item); |
There was a problem hiding this comment.
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 ; |
There was a problem hiding this comment.
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.
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. |
i see difference transfered_bytes only shows the speed and total_bytes gets printed when im right
|
any news? update this pr |
@RetroPooh can you update your pr |
what abiut this? we need this feature |
i see no issue there when its merge we has more stats |
No description provided.