Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add -D flag to print timestamp in front of output lines. #42

Merged
merged 2 commits into from May 21, 2013

Conversation

Projects
None yet
3 participants
Contributor

tohojo commented Mar 11, 2013

I'm looking to support fping as an ICMP measurement tool in the netperf-wrappers utility for testing bufferbloat (see https://github.com/tohojo/netperf-wrappers). In order to do this, I need to be able to timestamp output, to correlate it with bandwidth measurements.

This pull request contains a patch to add a -D flag which will print a UNIX timestamp before each output line, similar to how the Linux ping utility works.

@liudongmiao liudongmiao and 1 other commented on an outdated diff Mar 12, 2013

@@ -1823,6 +1828,11 @@ int wait_for_reply(long wait_time)
if( per_recv_flag )
{
+ if(timestamp_flag) {
+ printf("[%lu.%04lu] ",
@liudongmiao

liudongmiao Mar 12, 2013

why dont use %06lu for usec?

@tohojo

tohojo Mar 12, 2013

Contributor

Hmm, good question. No particular reason; I think it may be a remnant from another place I was using the same code that had buffer size constraints. Changing it to %06lu is fine by me. :)

Contributor

tohojo commented Apr 25, 2013

So any chance to get this merged?

Owner

schweikert commented Apr 29, 2013

Yes, I still want to test it, but I don't see right now why it shouldn't.

Contributor

tohojo commented Apr 29, 2013

David Schweikert notifications@github.com writes:

Yes, I still want to test it, but I don't see right now why it
shouldn't.

Excellent. Let me know if there's anything I can do to help. :)

-Toke

@schweikert schweikert added a commit that referenced this pull request May 21, 2013

@schweikert schweikert Merge pull request #42 from tohojo/master
Add -D flag to print timestamp in front of output lines.
543d221

@schweikert schweikert merged commit 543d221 into schweikert:master May 21, 2013

Contributor

tohojo commented May 22, 2013

Excellent; thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment