ASF Bugzilla – Attachment 22234 Details for
Bug 45356
ab: optionally reduce resource usage (qsort and memory)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Add '-s' to disable keeping all request data in memory
ab.c-no_data_save-11.patch (text/plain), 3.91 KB, created by
Rainer Jung
on 2008-07-07 11:09:48 UTC
(
hide
)
Description:
Add '-s' to disable keeping all request data in memory
Filename:
MIME Type:
Creator:
Rainer Jung
Created:
2008-07-07 11:09:48 UTC
Size:
3.91 KB
patch
obsolete
>--- ab.c-no_qsort-10 2008-07-07 18:36:44.000000000 +0200 >+++ ab.c-no_data_save-11 2008-07-07 19:01:06.000000000 +0200 >@@ -301,6 +301,7 @@ > int percentile = 1; /* Show percentile served */ > int confidence = 1; /* Show confidence estimator and warnings */ > int use_qsort = 1; /* Produce statistics for which we need to qsort() all data */ >+int use_stats = 1; /* Record stats for each request */ > int tlimit = 0; /* time limit in secs */ > int keepalive = 0; /* try and do keepalive connections */ > int windowsize = 0; /* we use the OS default window size */ >@@ -1431,7 +1432,8 @@ > } > /* save out time */ > if (done < requests) { >- data_t *s = &stats[done++]; >+ data_t *s = &stats[use_stats ? done : 0]; >+ done++; > c->done = lasttime = apr_time_now(); > s->starttime = c->start; > s->ctime = ap_max(0, c->connect - c->start); >@@ -1674,7 +1676,8 @@ > err_length++; > } > if (done < requests) { >- data_t *s = &stats[done++]; >+ data_t *s = &stats[use_stats ? done : 0]; >+ done++; > doneka++; > c->done = apr_time_now(); > s->starttime = c->start; >@@ -1733,7 +1736,7 @@ > > con = calloc(concurrency, sizeof(struct connection)); > >- stats = calloc(requests, sizeof(data_t)); >+ stats = calloc(use_stats ? requests : 1, sizeof(data_t)); > > summary = calloc(1, sizeof(basic_stats_t)); > init_basic_results(summary); >@@ -2031,6 +2034,8 @@ > fprintf(stderr, " -S Do not show confidence estimators and warnings.\n"); > fprintf(stderr, " -Q Do not produce any statistics needing to sort result data.\n"); > fprintf(stderr, " Implies '-d' and '-S' and can not be combined with '-e'\n"); >+ fprintf(stderr, " -s Do not keep any per request result data and produce only simple statistics.\n"); >+ fprintf(stderr, " Saves memory when used with a huge number of 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"); >@@ -2201,7 +2206,7 @@ > #endif > > apr_getopt_init(&opt, cntxt, argc, argv); >- while ((status = apr_getopt(opt, "n:c:t:b:T:p:v:rkVhwix:y:z:C:H:P:A:g:X:de:SQq" >+ while ((status = apr_getopt(opt, "n:c:t:b:T:p:v:rkVhwix:y:z:C:H:P:A:g:X:de:SsQq" > #ifdef USE_SSL > "Z:f:" > #endif >@@ -2231,14 +2236,16 @@ > posting = -1; > break; > case 'g': >+ if (!use_stats) >+ err("Cannot combine '-s' with '-g'"); > gnuplot = strdup(optarg); > break; > case 'd': > percentile = 0; > break; > case 'e': >- if (!use_qsort) >- err("Cannot combine '-Q' with '-e'"); >+ if (!use_qsort || !use_stats) >+ err("Cannot combine '-Q' or '-s' with '-e'"); > csvperc = strdup(optarg); > break; > case 'S': >@@ -2246,7 +2253,17 @@ > break; > case 'Q': > if (csvperc) >- err("Cannot combine '-Q' with '-e'"); >+ err("Cannot combine '-Q' or '-s' with '-e'"); >+ use_qsort = 0; >+ percentile = 0; >+ confidence = 0; >+ break; >+ case 's': >+ if (csvperc) >+ err("Cannot combine '-Q' or '-s' with '-e'"); >+ if (gnuplot) >+ err("Cannot combine '-s' with '-g'"); >+ use_stats = 0; > use_qsort = 0; > percentile = 0; > confidence = 0;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 45356
:
22232
|
22233
| 22234