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

hex vs dec #232

Open
ygrek opened this issue Sep 24, 2018 · 1 comment
Open

hex vs dec #232

ygrek opened this issue Sep 24, 2018 · 1 comment

Comments

@ygrek
Copy link

ygrek commented Sep 24, 2018

new protocol sends numbers in hex over the wire. Now the logs are harder to correlate with network events - because numbers in log are decimal (but actually not always, sometimes in hex too!) :

09-24-2018 02:55:08.239 DEBUG - (ClientSM.cc:278) C177429C 5.188.15.134:53844 -req: status: 0  buffers: 4096 write-id-alloc: seq: 3966475319232917609 client-seq: 743518551791084071 chunk: 288317120 version: 1 servers: 5.188.15.134 521a 5.188.12.211 5216 status: 0 msg:  took: 0 usec.

I understand this was done to save bandwidth apparently, but it is quite confusing/inconvenient now, every grep needs to be done twice.

@mikeov
Copy link
Contributor

mikeov commented Sep 24, 2018

Reducing CPU utilization in the critical paths by changing radix 10 to radix 16, with allows to replace division with shift was more important consideration, than the overhead / bandwidth / memory.

Grep regular expression seems to be reasonably efficient way to find both hex and decimal representations in one pass. For example:

grep -E '(1e240|123456)'

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

No branches or pull requests

2 participants