Opened 7 months ago

Closed 7 months ago

#29712 closed defect (not a bug)

sbws should use 1024 to convert kilobytes to bytes

Reported by: teor Owned by:
Priority: Low Milestone: sbws: 1.0.x-final
Component: Core Tor/sbws Version:
Severity: Minor Keywords:
Cc: juga Actual Points:
Parent ID: Points: 0.2
Reviewer: Sponsor:

Description (last modified by teor)

sbws converts kilobytes to bytes using 1000. But most systems use 1024 to conviert kilobytes to bytes.

Fixing this issue is not a high priority, because bandwidth measurements are only 20-50% accurate.

Also, the conversion factor should be a constant, rather than copying 1024 to lots of places in the code.

Child Tickets

Change History (3)

comment:1 Changed 7 months ago by teor

Description: modified (diff)

Edit: use a constant

comment:2 Changed 7 months ago by starlight

Network bandwidth measurements are by convention represented in KB, MB, GB units etc. rather than KiB, MiB, Gib. One example is Linux traffic control. Torflow and other Tor software apply KB with the notable exception of Atlas, which IMO is incorrect.

comment:3 in reply to:  2 Changed 7 months ago by teor

Resolution: not a bug
Status: newclosed

Replying to starlight:

Network bandwidth measurements are by convention represented in KB, MB, GB units etc. rather than KiB, MiB, Gib. One example is Linux traffic control. Torflow and other Tor software apply KB with the notable exception of Atlas, which IMO is incorrect.

You're right, Torflow and pytorctl use 1000:
https://gitweb.torproject.org/torflow.git/tree/NetworkScanners/BwAuthority/aggregate.py#n62
https://gitweb.torproject.org/pytorctl.git/tree/TorCtl.py#n1221

Note: See TracTickets for help on using tickets.