From 8336877feb861792f249b763d70ff8b5aecbf338 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Sun, 2 Jun 2013 06:30:03 +0000 Subject: [PATCH] Add a new -l parameter in order not to check the length of the responses. This can be usefull with dynamic pages. PR9945, PR27888, PR42040 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1488644 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ docs/manual/programs/ab.xml | 6 ++++++ support/ab.c | 27 ++++++++++++++++++++------- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 9ad28d5830b..f2510d2bdc0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) ab: Add a new -l parameter in order not to check the length of the responses. + This can be usefull with dynamic pages. + PR9945, PR27888, PR42040 [] + *) mod_ssl: Fix possible truncation of OCSP responses when reading from the server. [Joe Orton] diff --git a/docs/manual/programs/ab.xml b/docs/manual/programs/ab.xml index 660fd4737aa..640b1321933 100644 --- a/docs/manual/programs/ab.xml +++ b/docs/manual/programs/ab.xml @@ -49,6 +49,7 @@ [ -H custom-header ] [ -i ] [ -k ] + [ -l ] [ -n requests ] [ -p POST-file ] [ -P proxy-auth-username:password ] @@ -127,6 +128,11 @@
Enable the HTTP KeepAlive feature, i.e., perform multiple requests within one HTTP session. Default is no KeepAlive.
+
-l
+
Do not report errors if the length of the responses is not constant. This + can be usefull for dynamic pages. +
+
-n requests
Number of requests to perform for the benchmarking session. The default is to just perform a single request which usually leads to diff --git a/support/ab.c b/support/ab.c index 5fb6bf81c20..95bf2edf201 100644 --- a/support/ab.c +++ b/support/ab.c @@ -273,6 +273,7 @@ int requests = 1; /* Number of requests to make */ 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 nolength = 0; /* Accept variable document length */ int confidence = 1; /* Show confidence estimator and warnings */ int tlimit = 0; /* time limit in secs */ int keepalive = 0; /* try and do keepalive connections */ @@ -787,7 +788,10 @@ static void output_results(int sig) #endif printf("\n"); printf("Document Path: %s\n", path); - printf("Document Length: %" APR_SIZE_T_FMT " bytes\n", doclen); + if (nolength) + printf("Document Length: Variable\n"); + else + printf("Document Length: %" APR_SIZE_T_FMT " bytes\n", doclen); printf("\n"); printf("Concurrency Level: %d\n", concurrency); printf("Time taken for tests: %.3f seconds\n", timetaken); @@ -1059,9 +1063,14 @@ static void output_html_results(void) printf("Document Path:" "%s\n", trstring, tdstring, tdstring, path); - printf("Document Length:" - "%" APR_SIZE_T_FMT " bytes\n", - trstring, tdstring, tdstring, doclen); + if (nolength) + printf("Document Length:" + "Variable\n", + trstring, tdstring, tdstring); + else + printf("Document Length:" + "%" APR_SIZE_T_FMT " bytes\n", + trstring, tdstring, tdstring, doclen); printf("Concurrency Level:" "%d\n", trstring, tdstring, tdstring, concurrency); @@ -1299,7 +1308,7 @@ static void close_connection(struct connection * c) /* first time here */ doclen = c->bread; } - else if (c->bread != doclen) { + else if ((c->bread != doclen) && !nolength) { bad++; err_length++; } @@ -1543,7 +1552,7 @@ static void read_connection(struct connection * c) /* first time here */ doclen = c->bread; } - else if (c->bread != doclen) { + else if ((c->bread != doclen) && !nolength) { bad++; err_length++; } @@ -1907,6 +1916,7 @@ static void usage(const char *progname) 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, " -l Accept variable document length (use this for dynamic pages)\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"); @@ -2091,7 +2101,7 @@ int main(int argc, const char * const argv[]) myhost = NULL; /* 0.0.0.0 or :: */ apr_getopt_init(&opt, cntxt, argc, argv); - 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:" + while ((status = apr_getopt(opt, "n:c:t:s:b:T:p:u:v:lrkVhwix:y:z:C:H:P:A:g:X:de:SqB:" #ifdef USE_SSL "Z:f:" #endif @@ -2153,6 +2163,9 @@ int main(int argc, const char * const argv[]) method = PUT; send_body = 1; break; + case 'l': + nolength = 1; + break; case 'r': recverrok = 1; break; -- 2.47.3