httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jaillet...@apache.org
Subject svn commit: r1422937 - in /httpd/httpd/trunk: docs/manual/programs/ab.xml support/ab.c
Date Mon, 17 Dec 2012 14:10:51 GMT
Author: jailletc36
Date: Mon Dec 17 14:10:50 2012
New Revision: 1422937

URL: http://svn.apache.org/viewvc?rev=1422937&view=rev
Log:
ab: add the possibility to define a socket timeout (-s timeout)
[Guido Serra <zeph fsfe org>]

Also some changes In usage():
- reword -t option to be more clear with the new -s
- add missing -q
- add the new -s option
- reword some options to better match online documentation

ab.xml claimed that -s was already there, but nothing in the code looks like that.
So, I guess it only landed on the online doc...

Modified:
    httpd/httpd/trunk/docs/manual/programs/ab.xml
    httpd/httpd/trunk/support/ab.c

Modified: httpd/httpd/trunk/docs/manual/programs/ab.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/programs/ab.xml?rev=1422937&r1=1422936&r2=1422937&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/programs/ab.xml (original)
+++ httpd/httpd/trunk/docs/manual/programs/ab.xml Mon Dec 17 14:10:50 2012
@@ -54,7 +54,7 @@
     [ -<strong>P</strong> <var>proxy-auth-username</var>:<var>password</var>
]
     [ -<strong>q</strong> ]
     [ -<strong>r</strong> ]
-    [ -<strong>s</strong> ]
+    [ -<strong>s</strong> <var>timeout</var> ]
     [ -<strong>S</strong> ]
     [ -<strong>t</strong> <var>timelimit</var> ]
     [ -<strong>T</strong> <var>content-type</var> ]
@@ -150,11 +150,9 @@
     <dt><code>-r</code></dt>
     <dd>Don't exit on socket receive errors.</dd>
 
-   <dt><code>-s</code></dt>
-    <dd>When compiled in (<code>ab -h</code> will show you) use the SSL
-    protected <code>https</code> rather than the <code>http</code>
protocol.
-    This feature is experimental and <em>very</em> rudimentary. You probably
-    do not want to use it.</dd>
+    <dt><code>-s <var>timeout</var></code></dt>
+    <dd>Maximum number of seconds to wait before the socket times out.
+    Default is 30 seconds.</dd>
 
     <dt><code>-S</code></dt>
     <dd>Do not display the median and standard deviation values, nor display
@@ -170,7 +168,7 @@
     <dt><code>-T <var>content-type</var></code></dt>
     <dd>Content-type header to use for POST/PUT data, eg.
     <code>application/x-www-form-urlencoded</code>.
-    Default: <code>text/plain</code>.</dd>
+    Default is <code>text/plain</code>.</dd>
 
     <dt><code>-u <var>PUT-file</var></code></dt>
     <dd>File containing data to PUT.  Remember to also set <code>-T</code>.</dd>

Modified: httpd/httpd/trunk/support/ab.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/support/ab.c?rev=1422937&r1=1422936&r2=1422937&view=diff
==============================================================================
--- httpd/httpd/trunk/support/ab.c (original)
+++ httpd/httpd/trunk/support/ab.c Mon Dec 17 14:10:50 2012
@@ -1872,13 +1872,16 @@ static void usage(const char *progname)
  */
     fprintf(stderr, "Options are:\n");
     fprintf(stderr, "    -n requests     Number of requests to perform\n");
-    fprintf(stderr, "    -c concurrency  Number of multiple requests to make\n");
-    fprintf(stderr, "    -t timelimit    Seconds to max. wait for responses\n");
+    fprintf(stderr, "    -c concurrency  Number of multiple requests to make at a time\n");
+    fprintf(stderr, "    -t timelimit    Seconds to max. to spend on benchmarking\n");
+    fprintf(stderr, "                    This implies -n 50000\n");
+    fprintf(stderr, "    -s timeout      Seconds to max. wait for each response\n");
+    fprintf(stderr, "                    Default is 30 seconds\n");
     fprintf(stderr, "    -b windowsize   Size of TCP send/receive buffer, in bytes\n");
     fprintf(stderr, "    -B address      Address to bind to when making outgoing connections\n");
     fprintf(stderr, "    -p postfile     File containing data to POST. Remember also to set
-T\n");
     fprintf(stderr, "    -u putfile      File containing data to PUT. Remember also to set
-T\n");
-    fprintf(stderr, "    -T content-type Content-type header for POSTing, eg.\n");
+    fprintf(stderr, "    -T content-type Content-type header to use for POST/PUT data, eg.\n");
     fprintf(stderr, "                    'application/x-www-form-urlencoded'\n");
     fprintf(stderr, "                    Default is 'text/plain'\n");
     fprintf(stderr, "    -v verbosity    How much troubleshooting info to print\n");
@@ -1899,6 +1902,7 @@ static void usage(const char *progname)
     fprintf(stderr, "    -k              Use HTTP KeepAlive feature\n");
     fprintf(stderr, "    -d              Do not show percentiles served table.\n");
     fprintf(stderr, "    -S              Do not show confidence estimators and warnings.\n");
+    fprintf(stderr, "    -q              Do not show progress when doing more than 150 requests\n");
     fprintf(stderr, "    -g filename     Output collected data to gnuplot format file.\n");
     fprintf(stderr, "    -e filename     Output CSV file with percentages served\n");
     fprintf(stderr, "    -r              Don't exit on socket receive errors.\n");
@@ -2083,7 +2087,7 @@ int main(int argc, const char * const ar
     myhost = NULL; /* 0.0.0.0 or :: */
 
     apr_getopt_init(&opt, cntxt, argc, argv);
-    while ((status = apr_getopt(opt, "n:c:t:b:T:p:u:v:rkVhwix:y:z:C:H:P:A:g:X:de:SqB:"
+    while ((status = apr_getopt(opt, "n:c:t:s:b:T:p:u:v:rkVhwix:y:z:C:H:P:A:g:X:de:SqB:"
 #ifdef USE_SSL
             "Z:f:"
 #endif
@@ -2124,6 +2128,9 @@ int main(int argc, const char * const ar
             case 'S':
                 confidence = 0;
                 break;
+            case 's':
+                aprtimeout = apr_time_from_sec(atoi(opt_arg)); /* timeout value */
+                break;
             case 'p':
                 if (method != NO_METH)
                     err("Cannot mix POST with other methods\n");



Mime
View raw message