Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upI added more decimal digits to the timing statistics counters #1106
Conversation
This comment has been minimized.
This comment has been minimized.
mention-bot
commented
Nov 4, 2016
@maurorappa, thanks for your PR! By analyzing the history of the files in this pull request, we identified @bagder, @gevaerts and @yangtse to be potential reviewers. |
bagder
added
the
cmdline tool
label
Nov 5, 2016
bagder
closed this
in
ebeffe8
Nov 5, 2016
This comment has been minimized.
This comment has been minimized.
thanks! |
This comment has been minimized.
This comment has been minimized.
Could this conceivably break some scripts if they expect data in a 0.000 and is microsecond really necessary for those statistics? All I get is a lot of x.xxx000 |
This comment has been minimized.
This comment has been minimized.
This is my output on Ubuntu Trusty: maurorappa@trusty:~/curl/src$ ./curl -sLk -w "%{http_code}\n%{time_total}: %{time_namelookup} %{time_connect} %{time_appconnect}\n%{speed_download} %{num_redirects}\n" https://dcs.ida.digital.cabinet-office.gov.uk -o /dev/null I can do statistical analysis of the SSL performance with more granularity. |
This comment has been minimized.
This comment has been minimized.
Ok. time_total is documented as millisecond resolution so that's something we have to consider. And I suspect it becomes somewhat more arbitrary after that since it's basically wall clock time. What if there was a variable like %{flags:microseconds,foo,bar} |
This comment has been minimized.
This comment has been minimized.
Ah yes good catch, |
This comment has been minimized.
This comment has been minimized.
I can fix the man page if it helps. |
This comment has been minimized.
This comment has been minimized.
Yes please, the millisecond mention is wrong now since commit ebeffe8 |
added a commit
to jay/curl
that referenced
this pull request
Nov 8, 2016
This comment has been minimized.
This comment has been minimized.
I think we should not do this by default, and that adding it as an option would be better. To that end I've written a counterproposal, you can see it at https://github.com/curl/curl/compare/master...jay:add_flags_to_write-out?expand=1 curld -sS --write-out " %{time_total} %{flags: moreprec,stderr} %{time_total}" example.com -o NUL 2>NUL
0.047
curld -sS --write-out " %{time_total} %{flags: moreprec,stderr} %{time_total}" example.com -o NUL 1>NUL
0.047000 |
This comment has been minimized.
This comment has been minimized.
Because of the risk that it will break some scripts? Because some machines won't have better accuracy than milliseconds anyway? What about inventing some additional syntax hint that allows users to specify precision per variable. like |
bagder
reopened this
Nov 8, 2016
This comment has been minimized.
This comment has been minimized.
For all those reasons, but also with respect to the reporter measurements based off of differences in wall clock time are only so accurate. Your way is interesting, however I like the idea of %{flags regardless because it's extensible |
added a commit
to jay/curl
that referenced
this pull request
Nov 28, 2016
This comment has been minimized.
This comment has been minimized.
I just finished draft2 of this, if the feature window hasn't closed yet and there is interest. I still need a test.
Conceivably in Linux and cygwin it should work on 3>foo and if %{flags:fd3} the write-out text will go there. It won't work in Windows. |
This comment has been minimized.
This comment has been minimized.
I think we can just leave the digits as they are as nobody has reported any problems with this change so far. |
This comment has been minimized.
This comment has been minimized.
stale
bot
commented
Oct 27, 2017
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
stale
bot
added
the
stale
label
Oct 27, 2017
This comment has been minimized.
This comment has been minimized.
Ok |
maurorappa commentedNov 4, 2016
•
edited
in order to provide more detailed performance statistics, I changed the printf to use 6 decimals.
Luckily enough the metrics were already using double integers.