I am trying to obtain the transaction times for loading a webpage in a java app. I would like to get a breakdown of the loading, similar to the output that the cURL tool provides:
Command:
$ curl -L --output /dev/null --silent --show-error --write-out 'lookup:%{time_namelookup}\n connect:%{time_connect}\n appconnect:%{time_appconnect}\n pretransfer:%{time_pretransfer}\n redirect:%{time_redirect}\n starttransfer:%{time_starttransfer}\n total:%{time_total}\n' 'google.com'
Result:
lookup: 0.036
connect: 0.053
appconnect: 0.000
pretransfer: 0.053
redirect: 0.105
starttransfer: 0.118
total: 0.253
I have read about one or two curl java wrappers (such as libcurl discussed here [1]), but I have also read that using a native java approach would likely be the better method.
Is there any native class or third party library that supports the display of these statistics?