router statistics - sort tunnels by traffic (libr)#108
router statistics - sort tunnels by traffic (libr)#108RetroPooh wants to merge 1 commit intoRetroShare:masterfrom
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.
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.
| 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.
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
|
No description provided.