locate Protocol/http.pm
or similar to find where your LWP::Protocol::http module lives. Mine is in /usr/share/perl5/LWP/Protocol/http.pm.
Search for the request() subroutine. Add these lines up at the top of it:
use Time::HiRes qw(time);
my @times;
Add a line containing "push @times, time();"
before the following three lines:
if ($has_content) { block,
...
$response = $self->collect($arg, $response, sub {
...
unless ($drop_connection) {
and then add this at the bottom:
warn "wrote-request read-headers read-content\n@times\n";
If this is anything but a quick hack, it might be better to subclass or otherwise hook into LWP::Protocol::http to make it more maintainable. Another approach would be to just do a HEAD and then a GET, with the difference in times being the content-transfer time. |