rse 98/03/17 04:53:32
Modified: src/test zb.c
Log:
Backout my recent changes, because we now have src/support/ab.[c1] which
already contains these changes together with a lot of other cleanups. Better
to leave the original zb.c as original as it can be... (BTW: This zb.c is
already not really original, because there were already two commits from Dean
in the past)
Revision Changes Path
1.4 +16 -23 apache-1.3/src/test/zb.c
Index: zb.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/test/zb.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- zb.c 1998/03/16 15:23:24 1.3
+++ zb.c 1998/03/17 12:53:31 1.4
@@ -191,10 +191,9 @@
gettimeofday(&endtime,0);
timetaken = timedif(endtime, start);
- printf("Server Hostname: %s\n", machine);
- printf("Server Software: %s\n", server_name);
- printf("Document Path: %s\n", file);
- printf("Document Length: %d bytes\n", doclen);
+ printf("\n---\n");
+ printf("Server: %s\n", server_name);
+ printf("Document Length: %d\n", doclen);
printf("Concurency Level: %d\n", concurrency);
printf("Time taken for tests: %d.%03d seconds\n",
timetaken/1000, timetaken%1000);
@@ -203,8 +202,8 @@
if(bad) printf(" (Connect: %d, Length: %d, Exceptions: %d)\n",
err_conn, err_length, err_except);
if(keepalive) printf("Keep-Alive requests: %d\n", doneka);
- printf("Total transfered: %d bytes\n", totalread);
- printf("HTML transfered: %d bytes\n", totalbread);
+ printf("Bytes transfered: %d\n", totalread);
+ printf("HTML transfered: %d\n", totalbread);
/* avoid divide by zero */
if(timetaken) {
@@ -233,6 +232,7 @@
printf(" min avg max\n");
printf("Connect: %5d %5d %5d\n",mincon, totalcon/requests, maxcon );
printf("Total: %5d %5d %5d\n", mintot, total/requests, maxtot);
+ printf("---\n\n");
}
exit(0);
@@ -453,7 +453,7 @@
FD_ZERO(&writebits);
/* setup request */
- sprintf(request,"GET %s HTTP/1.0\r\nUser-Agent: ZeusBench/1.01\r\n"
+ sprintf(request,"GET %s HTTP/1.0\r\nUser-Agent: ZeusBench/1.0\r\n"
"%sHost: %s\r\nAccept: */*\r\n\r\n", file,
keepalive?"Connection: Keep-Alive\r\n":"", machine );
@@ -509,16 +509,10 @@
/* display usage information */
void usage(char *progname) {
- printf("This is ZeusBench, Version v1.01\n");
- printf("\n");
- printf("Usage: %s [options] <machine> <path>\n", progname);
- printf(" -k KeepAlive\n");
- printf(" -n requests Number of requests to peforms\n");
- printf(" -t timelimit Seconds to max. wait for responses\n");
- printf(" -c concurrency Number of multiple requests to make\n");
- printf(" -p port Port number to use\n");
- printf("\n");
- printf("Path should start with a '/' e.g. /index.html\n\n");
+ printf("\nZeusBench v1.0\n\n");
+ printf("Usage: %s <machine> <file> [-k] [-n requests | -t timelimit (sec)]"
+ "\n\t\t[-c concurrency] [-p port] \n",progname);
+ printf("Filename should start with a '/' e.g. /index.html\n\n");
exit(EINVAL);
}
@@ -528,7 +522,11 @@
int main(int argc, char **argv) {
int c;
- optind = 1;
+ if (argc < 3) usage(argv[0]);
+
+ machine = argv[1];
+ file = argv[2];
+ optind = 3;
while ((c = getopt(argc,argv,"p:n:c:d:t:d:k"))>0) {
switch(c) {
case 'd':
@@ -558,11 +556,6 @@
break;
}
}
- if (optind != argc-2)
- usage(argv[0]);
-
- machine = argv[optind++];
- file = argv[optind++];
test();
return 0;
}