diff options
author | Martin Kraemer <martin@apache.org> | 2002-07-16 09:28:40 +0000 |
---|---|---|
committer | Martin Kraemer <martin@apache.org> | 2002-07-16 09:28:40 +0000 |
commit | 30304d48545f047d51a821e760c70714ff1482f9 (patch) | |
tree | 8f7951d8f5c47e19934440322af4752feb6ac54a /support | |
parent | ad46a61a10d64741b38a5e4f1561d92f1c9bb43f (diff) | |
download | httpd-30304d48545f047d51a821e760c70714ff1482f9.tar.gz |
Fix the long-standing bug that "ab -t10" would loop for 10000 seconds
instead of 10 as documented. Also fix an off-by-one-second error, which
did not matter much (in comparison to the 1000x error ;-)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96073 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'support')
-rw-r--r-- | support/ab.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/support/ab.c b/support/ab.c index 3849d3c194..df19f00a25 100644 --- a/support/ab.c +++ b/support/ab.c @@ -278,7 +278,7 @@ int heartbeatres = 100; /* How often do we say we're alive */ int concurrency = 1; /* Number of multiple requests to make */ int percentile = 1; /* Show percentile served */ int confidence = 1; /* Show confidence estimator and warnings */ -int tlimit = 0; /* time limit in cs */ +int tlimit = 0; /* time limit in secs */ int keepalive = 0; /* try and do keepalive connections */ char servername[1024]; /* name that server reports */ char *hostname; /* host name from URL */ @@ -1639,8 +1639,9 @@ static void test(void) /* check for time limit expiry */ now = apr_time_now(); timed = (apr_int32_t)apr_time_sec(now - start); - if (tlimit && timed > (tlimit * 1000)) { + if (tlimit && timed >= tlimit) { requests = done; /* so stats are correct */ + break; /* no need to do another round */ } n = concurrency; @@ -1726,14 +1727,14 @@ static void test(void) static void copyright(void) { if (!use_html) { - printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.111 $> apache-2.0"); + printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.112 $> apache-2.0"); printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n"); printf("Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/\n"); printf("\n"); } else { printf("<p>\n"); - printf(" This is ApacheBench, Version %s <i><%s></i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.111 $"); + printf(" This is ApacheBench, Version %s <i><%s></i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.112 $"); printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n"); printf(" Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/<br>\n"); printf("</p>\n<p>\n"); |