in reply to RFC: LWP::UserAgent hit counter

How typical is this output? I got it do be different than this once.

$ ./1.ua.pl ./1.ua.pl : turning hit counter on ... ./1.ua.pl : hit count is now: 0 hits over 0 s (to last hit) or over 1 +s (to now/when stopped) (0.00 or 0.00 hits/hour) ok 1 - time intervals (up-to-last-hit) must be zero on turn-on (0) ok 2 - time intervals (up-to-stopped) records since turn-on irrespecti +ve of hits (1) ok 3 - 0 hits at turn-on ./1.ua.pl : hitting site with GET 'http://www.python.org' ... ./1.ua.pl : success hitting http://www.python.org ./1.ua.pl : hit count is now: 2 hits over 2 s (to last hit) or over 3 +s (to now/when stopped) (3600.00 or 2400.00 hits/hour) ok 4 - time interval (up-to-stopped) must be positive (let's say 1-20 +seconds). ok 5 - time interval (up-to-last-hit) must be positive (let's say 1-20 + seconds). ok 6 - 2 hits because of a redirect ./1.ua.pl : turning hit counter off ... ./1.ua.pl : hit count is now: 2 hits over 2 s (to last hit) or over 3 +s (to now/when stopped) (3600.00 or 2400.00 hits/hour) ./1.ua.pl : hitting site with GET 'http://www.python.org' ... ./1.ua.pl : success hitting http://www.python.org ./1.ua.pl : hit count is now: 2 hits over 2 s (to last hit) or over 3 +s (to now/when stopped) (3600.00 or 2400.00 hits/hour) ok 7 - no change in time interval because counter is off ok 8 - no change in time interval because counter is off ok 9 - no change in hits because counter is off ./1.ua.pl : turning hit counter back on again ... ./1.ua.pl : hit count is now: 0 hits over 0 s (to last hit) or over 0 +s (to now/when stopped) (0.00 or 0.00 hits/hour) ok 10 - hit count after starting ok 11 - time interval to-now after starting must be positive integer ( +after slept for 1) ok 12 - time interval since last hit must be zero, no hits yet ./1.ua.pl : hitting site with GET 'http://www.python.org' ... ./1.ua.pl : success hitting http://www.python.org ./1.ua.pl : hit count is now: 2 hits over 2 s (to last hit) or over 3 +s (to now/when stopped) (3600.00 or 2400.00 hits/hour) ok 13 - time interval must be positive (let's say 1-20 seconds). ok 14 - time interval must be positive (let's say 1-20 seconds). ok 15 - 2 hits because of a redirect ./1.ua.pl : hitting site with GET 'http://www.python.org' again ... ./1.ua.pl : success hitting http://www.python.org ./1.ua.pl : hit count is now: 4 hits over 8 s (to last hit) or over 9 +s (to now/when stopped) (1800.00 or 1600.00 hits/hour) ok 16 - time interval must be positive (let's say 1-20 seconds). ok 17 - time interval must be positive (let's say 1-20 seconds). ok 18 - 2 more hits because of a redirect ./1.ua.pl : resetting hit counter ... ./1.ua.pl : hit count is now: 0 hits over 0 s (to last hit) or over 0 +s (to now/when stopped) (0.00 or 0.00 hits/hour) ok 19 - time interval must be zero after reset ok 20 - time interval must be zero after reset ok 21 - number of hits must be zero after reset ./1.ua.pl : hitting site with a POST 'https://www.w3schools.com/action +_page.php' ... ./1.ua.pl : success hitting https://www.w3schools.com/action_page.php ./1.ua.pl : hit count is now: 1 hits over 1 s (to last hit) or over 1 +s (to now/when stopped) (3600.00 or 3600.00 hits/hour) ok 22 - time interval must be positive (let's say 1-20 seconds). ok 23 - time interval must be positive (let's say 1-20 seconds). ok 24 - 1 hit this time... 1..24 ./1.ua.pl : done. $

I wonder how this output might change with different sites and different forms.

Replies are listed 'Best First'.
Re^2: RFC: LWP::UserAgent hit counter
by bliako (Abbot) on Jul 06, 2018 at 22:40 UTC
    ok 16 - time interval must be positive (let's say 1-20 seconds).
    

    test script allows for some long response time, it does not test the exact amount of seconds but rather the exact amount of hits over some reasonable time interval.