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:locate Protocol/http.pm
Add a line containing "push @times, time();" before the following three lines:use Time::HiRes qw(time); my @times;
and then add this at the bottom:if ($has_content) { block, ... $response = $self->collect($arg, $response, sub { ... unless ($drop_connection) {
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.warn "wrote-request read-headers read-content\n@times\n";
In reply to Re^3: Using LWP: is there a way to get the server response time?
by PreferredUserName
in thread Using LWP: is there a way to get the server response time?
by isync
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |