GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  LWPX::TIMEDHTTP (3)

.ds Aq ’

NAME

LWPx::TimedHTTP - time the different stages of an HTTP request

CONTENTS

SYNOPSIS



    # do the work for you
    use LWP::UserAgent;                                                                                                                
    use LWPx::TimedHTTP qw(:autoinstall);                                                                                    

    # now just continue as normal                                                                                                              
    my $ua = LWP::UserAgent->new;                                                                                                       
    my $response = $ua->get("http://thegestalt.org");                                                                                  
    # ... with optional retrieving of metrics (in seconds)
    printf  "%f\n", $response->header(Client-Request-Connect-Time); 


    # or if you dont like magic going on in the background
    use LWP::UserAgent;                                                                                                                
    use LWP::Protocol;                                                                                                                 
    use LWPx::TimedHTTP;   

    LWP::Protocol::implementor(http,  LWPx::TimedHTTP);                                                                  

    # or for https ....
    LWP::Protocol::implementor(https, LWPx::TimedHTTP::https);

    my $ua = LWP::UserAgent->new;                                                                                                           
    my $response = $ua->get("http://thegestalt.org");                                                                                      
    printf  "%f\n", $response->header(Client-Request-Connect-Time);



DESCRIPTION

This module performs an HTTP request exactly the same as <B>LWPB> does normally except for the fact that it times each stage of the request and then inserts the results as header.

It’s useful for debugging where abouts in a connection slow downs are occuring.

METRICS

All times returned are in seconds

    Client-Request-Dns-Time

The time it took to do a DNS lookup on the host.

<B>NOTE:B> The value of this timing is NOT thread safe since it has to smuggle the data back via a global variable.

    Client-Request-Connect-Time

The time it took to connect to the remote server

    Client-Request-Transmit-Time

The time it took to transmit the request

    Client-Response-Server-Time

Time it took to respond to the request

    Client-Response-Receive-Time

Time it took to get the data back

AUTHOR

Simon Wistow <simon@thegestalt.org>

Based entirely on work by David Carter - this module is a little light frobbing and some packaging of code he posted to the libwww-perl mailing list in response to one of my questions.

His code was, in turn, based on <B>LWP::Protocol::httpB> by Gisle Aas which is distributed as part of the <B>libwwwB> package.

COPYING

(c)opyright 2002, Simon Wistow

Distributed under the same terms as Perl itself.

This software is under no warranty and will probably ruin your life, kill your friends, burn your house and bring about the apocalypse

BUGS

None known

SEE ALSO

LWP::UserAgent, Time::HiRes
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 LWPX::TIMEDHTTP (3) 2016-04-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.