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

Tool tcpsubnet #1618

Merged
merged 6 commits into from
Mar 6, 2018
Merged

Tool tcpsubnet #1618

merged 6 commits into from
Mar 6, 2018

Conversation

rmanyari
Copy link

@rmanyari rmanyari commented Mar 3, 2018

PR for 1571

I updated the tool based on Brendan's feedback, added some validation as well.

Signed-off-by: Rodrigo Manyari [email protected]

@yonghong-song
Copy link
Collaborator

[buildbot, ok to test]

@yonghong-song
Copy link
Collaborator

Tested. Looks good.

cc @brendangregg

@brendangregg
Copy link
Member

Looks good. A couple of things.

I'd add 0.0.0.0/0 to the default, as a catch-all.

And there should be a newline after the output, or a timestamp line before the output (like argparse's "[18:21:00]"), because without these, we can't really understand the output. Eg:

# ./tcpsubnet.py
Tracing... Output every 1 secs. Hit Ctrl-C to end
127.0.0.1/32            2734
127.0.0.1/32             183
^C

Was that 2734 segments in the first second, and then 183 segments in the second? No, it wasn't, they were several seconds apart, but tcpsubnet prints nothing if there was no activity. It should look like this, at least:

# ./tcpsubnet.py
Tracing... Output every 1 secs. Hit Ctrl-C to end
127.0.0.1/32            2734





127.0.0.1/32             183

^C

Or:

# ./tcpsubnet.py
Tracing... Output every 1 secs. Hit Ctrl-C to end
[18:21:03]
127.0.0.1/32            2734
[18:21:04]
[18:21:05]
[18:21:06]
[18:21:07]
[18:21:08]
127.0.0.1/32             183
^C

@rmanyari
Copy link
Author

rmanyari commented Mar 6, 2018

Good catch, the behavior was obvious to me but only because I wrote the tool... I made date and time keys in the JSON object, putting it as a header would defeat the point of having JSON in the first place.

I also updated the examples, man page and brought back 0.0.0.0/0 as the last default

@brendangregg brendangregg merged commit f34acfc into iovisor:master Mar 6, 2018
@brendangregg
Copy link
Member

Looks good, thanks!

@rmanyari
Copy link
Author

rmanyari commented Mar 7, 2018

No problem, happy to contribute!

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