View | Details | Raw Unified | Return to bug 45356
Collapse All | Expand All

(-)ab.c-html_conf_perc-8 (-71 / +86 lines)
Lines 250-255 Link Here
250
    apr_interval_time_t ctime;    /* time to connect */
250
    apr_interval_time_t ctime;    /* time to connect */
251
    apr_interval_time_t time;     /* time for connection */
251
    apr_interval_time_t time;     /* time for connection */
252
};
252
};
253
typedef struct data data_t;
253
254
254
struct basic_stats {
255
struct basic_stats {
255
    apr_interval_time_t mincon;
256
    apr_interval_time_t mincon;
Lines 375-381 Link Here
375
int percs[] = {50, 66, 75, 80, 90, 95, 98, 99, 100};
376
int percs[] = {50, 66, 75, 80, 90, 95, 98, 99, 100};
376
377
377
struct connection *con;     /* connection array */
378
struct connection *con;     /* connection array */
378
struct data *stats;         /* data for each request */
379
data_t *stats;         /* data for each request */
380
basic_stats_t *summary;     /* statistical data that can be generated on the fly */
379
apr_pool_t *cntxt;
381
apr_pool_t *cntxt;
380
382
381
apr_pollset_t *readbits;
383
apr_pollset_t *readbits;
Lines 716-722 Link Here
716
718
717
/* calculate and output results */
719
/* calculate and output results */
718
720
719
static int compradre(struct data * a, struct data * b)
721
static int compradre(data_t * a, data_t * b)
720
{
722
{
721
    if ((a->ctime) < (b->ctime))
723
    if ((a->ctime) < (b->ctime))
722
        return -1;
724
        return -1;
Lines 725-731 Link Here
725
    return 0;
727
    return 0;
726
}
728
}
727
729
728
static int comprando(struct data * a, struct data * b)
730
static int comprando(data_t * a, data_t * b)
729
{
731
{
730
    if ((a->time) < (b->time))
732
    if ((a->time) < (b->time))
731
        return -1;
733
        return -1;
Lines 734-740 Link Here
734
    return 0;
736
    return 0;
735
}
737
}
736
738
737
static int compri(struct data * a, struct data * b)
739
static int compri(data_t * a, data_t * b)
738
{
740
{
739
    apr_interval_time_t p = a->time - a->ctime;
741
    apr_interval_time_t p = a->time - a->ctime;
740
    apr_interval_time_t q = b->time - b->ctime;
742
    apr_interval_time_t q = b->time - b->ctime;
Lines 745-751 Link Here
745
    return 0;
747
    return 0;
746
}
748
}
747
749
748
static int compwait(struct data * a, struct data * b)
750
static int compwait(data_t * a, data_t * b)
749
{
751
{
750
    if ((a->waittime) < (b->waittime))
752
    if ((a->waittime) < (b->waittime))
751
        return -1;
753
        return -1;
Lines 754-764 Link Here
754
    return 0;
756
    return 0;
755
}
757
}
756
758
757
static basic_stats_t *calculate_basic_results()
759
static void init_basic_results( basic_stats_t *r)
758
{
760
{
759
    /* work out connection times */
761
    if (!r)
760
    int i;
762
        return;
761
    basic_stats_t *r = calloc(1, sizeof(basic_stats_t));
762
763
763
    r->mincon = AB_MAX;
764
    r->mincon = AB_MAX;
764
    r->mintot = AB_MAX;
765
    r->mintot = AB_MAX;
Lines 776-802 Link Here
776
    r->meantot = 0;
777
    r->meantot = 0;
777
    r->meand = 0;
778
    r->meand = 0;
778
    r->meanwait = 0;
779
    r->meanwait = 0;
780
}
781
782
static void increment_basic_results(basic_stats_t *r, data_t *s)
783
{
784
    /* work out connection times */
785
    apr_interval_time_t t;
779
786
780
    if (done <= 0)
787
    if (done <= 0)
781
        return r;
788
        return;
782
789
783
    for (i = 0; i < done; i++) {
790
    t = s->time - s->ctime;
784
        struct data *s = &stats[i];
791
785
        r->mincon = ap_min(r->mincon, s->ctime);
792
    r->mincon = ap_min(r->mincon, s->ctime);
786
        r->mintot = ap_min(r->mintot, s->time);
793
    r->mintot = ap_min(r->mintot, s->time);
787
        r->mind = ap_min(r->mind, s->time - s->ctime);
794
    r->mind = ap_min(r->mind, t);
788
        r->minwait = ap_min(r->minwait, s->waittime);
795
    r->minwait = ap_min(r->minwait, s->waittime);
789
796
790
        r->maxcon = ap_max(r->maxcon, s->ctime);
797
    r->maxcon = ap_max(r->maxcon, s->ctime);
791
        r->maxtot = ap_max(r->maxtot, s->time);
798
    r->maxtot = ap_max(r->maxtot, s->time);
792
        r->maxd = ap_max(r->maxd, s->time - s->ctime);
799
    r->maxd = ap_max(r->maxd, t);
793
        r->maxwait = ap_max(r->maxwait, s->waittime);
800
    r->maxwait = ap_max(r->maxwait, s->waittime);
794
801
795
        r->totalcon += s->ctime;
802
    r->totalcon += s->ctime;
796
        r->total += s->time;
803
    r->total += s->time;
797
        r->totald += s->time - s->ctime;
804
    r->totald += t;
798
        r->totalwait += s->waittime;
805
    r->totalwait += s->waittime;
799
    }
806
}
807
808
static void finalize_basic_results(basic_stats_t *r)
809
{
810
    if (!r || done <= 0)
811
        return;
800
812
801
    r->meancon = r->totalcon / done;
813
    r->meancon = r->totalcon / done;
802
    r->meantot = r->total / done;
814
    r->meantot = r->total / done;
Lines 818-825 Link Here
818
    r->meand      = ap_round_ms(r->meand);
830
    r->meand      = ap_round_ms(r->meand);
819
    r->meanwait   = ap_round_ms(r->meanwait);
831
    r->meanwait   = ap_round_ms(r->meanwait);
820
    r->meantot    = ap_round_ms(r->meantot);
832
    r->meantot    = ap_round_ms(r->meantot);
821
822
    return r;
823
}
833
}
824
834
825
static confidence_stats_t *calculate_confidence_results(basic_stats_t *t)
835
static confidence_stats_t *calculate_confidence_results(basic_stats_t *t)
Lines 839-845 Link Here
839
849
840
    /* calculating the sample variance: the sum of the squared deviations, divided by n-1 */
850
    /* calculating the sample variance: the sum of the squared deviations, divided by n-1 */
841
    for (i = 0; i < done; i++) {
851
    for (i = 0; i < done; i++) {
842
        struct data *s = &stats[i];
852
        data_t *s = &stats[i];
843
        double a;
853
        double a;
844
        a = ((double)s->time - t->meantot);
854
        a = ((double)s->time - t->meantot);
845
        r->sdtot += a * a;
855
        r->sdtot += a * a;
Lines 861-874 Link Here
861
     * the four warnings during compile ? dirkx just does not know and
871
     * the four warnings during compile ? dirkx just does not know and
862
     * hates both/
872
     * hates both/
863
     */
873
     */
864
    qsort(stats, done, sizeof(struct data),
874
    qsort(stats, done, sizeof(data_t),
865
          (int (*) (const void *, const void *)) compradre);
875
          (int (*) (const void *, const void *)) compradre);
866
    if ((done > 1) && (done % 2))
876
    if ((done > 1) && (done % 2))
867
        r->mediancon = (stats[done / 2].ctime + stats[done / 2 + 1].ctime) / 2;
877
        r->mediancon = (stats[done / 2].ctime + stats[done / 2 + 1].ctime) / 2;
868
    else
878
    else
869
        r->mediancon = stats[done / 2].ctime;
879
        r->mediancon = stats[done / 2].ctime;
870
880
871
    qsort(stats, done, sizeof(struct data),
881
    qsort(stats, done, sizeof(data_t),
872
          (int (*) (const void *, const void *)) compri);
882
          (int (*) (const void *, const void *)) compri);
873
    if ((done > 1) && (done % 2))
883
    if ((done > 1) && (done % 2))
874
        r->mediand = (stats[done / 2].time + stats[done / 2 + 1].time \
884
        r->mediand = (stats[done / 2].time + stats[done / 2 + 1].time \
Lines 876-889 Link Here
876
    else
886
    else
877
        r->mediand = stats[done / 2].time - stats[done / 2].ctime;
887
        r->mediand = stats[done / 2].time - stats[done / 2].ctime;
878
888
879
    qsort(stats, done, sizeof(struct data),
889
    qsort(stats, done, sizeof(data_t),
880
          (int (*) (const void *, const void *)) compwait);
890
          (int (*) (const void *, const void *)) compwait);
881
    if ((done > 1) && (done % 2))
891
    if ((done > 1) && (done % 2))
882
        r->medianwait = (stats[done / 2].waittime + stats[done / 2 + 1].waittime) / 2;
892
        r->medianwait = (stats[done / 2].waittime + stats[done / 2 + 1].waittime) / 2;
883
    else
893
    else
884
        r->medianwait = stats[done / 2].waittime;
894
        r->medianwait = stats[done / 2].waittime;
885
895
886
    qsort(stats, done, sizeof(struct data),
896
    qsort(stats, done, sizeof(data_t),
887
          (int (*) (const void *, const void *)) comprando);
897
          (int (*) (const void *, const void *)) comprando);
888
    if ((done > 1) && (done % 2))
898
    if ((done > 1) && (done % 2))
889
        r->mediantot = (stats[done / 2].time + stats[done / 2 + 1].time) / 2;
899
        r->mediantot = (stats[done / 2].time + stats[done / 2 + 1].time) / 2;
Lines 1008-1028 Link Here
1008
1018
1009
    if (done > 0) {
1019
    if (done > 0) {
1010
        int i;
1020
        int i;
1011
        basic_stats_t *r = calculate_basic_results();
1012
1021
1022
        finalize_basic_results(summary);
1013
        printf("\nConnection Times (ms)\n");
1023
        printf("\nConnection Times (ms)\n");
1014
        if (confidence) {
1024
        if (confidence) {
1015
            confidence_stats_t *s = calculate_confidence_results(r);
1025
            confidence_stats_t *s = calculate_confidence_results(summary);
1016
#define CONF_FMT_STRING "%5" APR_TIME_T_FMT " %4" APR_TIME_T_FMT " %5.1f %6" APR_TIME_T_FMT " %7" APR_TIME_T_FMT "\n"
1026
#define CONF_FMT_STRING "%5" APR_TIME_T_FMT " %4" APR_TIME_T_FMT " %5.1f %6" APR_TIME_T_FMT " %7" APR_TIME_T_FMT "\n"
1017
            printf("              min  mean[+/-sd] median   max\n");
1027
            printf("              min  mean[+/-sd] median   max\n");
1018
            printf("Connect:    " CONF_FMT_STRING,
1028
            printf("Connect:    " CONF_FMT_STRING,
1019
                   r->mincon, r->meancon, s->sdcon, s->mediancon, r->maxcon);
1029
                   summary->mincon, summary->meancon, s->sdcon, s->mediancon, summary->maxcon);
1020
            printf("Processing: " CONF_FMT_STRING,
1030
            printf("Processing: " CONF_FMT_STRING,
1021
                   r->mind, r->meand, s->sdd, s->mediand, r->maxd);
1031
                   summary->mind, summary->meand, s->sdd, s->mediand, summary->maxd);
1022
            printf("Waiting:    " CONF_FMT_STRING,
1032
            printf("Waiting:    " CONF_FMT_STRING,
1023
                   r->minwait, r->meanwait, s->sdwait, s->medianwait, r->maxwait);
1033
                   summary->minwait, summary->meanwait, s->sdwait, s->medianwait, summary->maxwait);
1024
            printf("Total:      " CONF_FMT_STRING,
1034
            printf("Total:      " CONF_FMT_STRING,
1025
                   r->mintot, r->meantot, s->sdtot, s->mediantot, r->maxtot);
1035
                   summary->mintot, summary->meantot, s->sdtot, s->mediantot, summary->maxtot);
1026
#undef CONF_FMT_STRING
1036
#undef CONF_FMT_STRING
1027
1037
1028
#define     SANE(what,mean,median,sd) \
1038
#define     SANE(what,mean,median,sd) \
Lines 1036-1059 Link Here
1036
                    printf("WARNING: The median and mean for " what " are not within a normal deviation\n" \
1046
                    printf("WARNING: The median and mean for " what " are not within a normal deviation\n" \
1037
                           "        These results are probably not that reliable.\n"); \
1047
                           "        These results are probably not that reliable.\n"); \
1038
            }
1048
            }
1039
            SANE("the initial connection time", r->meancon, s->mediancon, s->sdcon);
1049
            SANE("the initial connection time", summary->meancon, s->mediancon, s->sdcon);
1040
            SANE("the processing time", r->meand, s->mediand, s->sdd);
1050
            SANE("the processing time", summary->meand, s->mediand, s->sdd);
1041
            SANE("the waiting time", r->meanwait, s->medianwait, s->sdwait);
1051
            SANE("the waiting time", summary->meanwait, s->medianwait, s->sdwait);
1042
            SANE("the total time", r->meantot, s->mediantot, s->sdtot);
1052
            SANE("the total time", summary->meantot, s->mediantot, s->sdtot);
1043
#undef SANE
1053
#undef SANE
1044
        }
1054
        }
1045
        else {
1055
        else {
1046
            printf("              min   avg   max\n");
1056
            printf("              min   avg   max\n");
1047
#define CONF_FMT_STRING "%5" APR_TIME_T_FMT " %5" APR_TIME_T_FMT "%5" APR_TIME_T_FMT "\n"
1057
#define CONF_FMT_STRING "%5" APR_TIME_T_FMT " %5" APR_TIME_T_FMT "%5" APR_TIME_T_FMT "\n"
1048
            printf("Connect:    " CONF_FMT_STRING, r->mincon, r->meancon, r->maxcon);
1058
            printf("Connect:    " CONF_FMT_STRING, summary->mincon, summary->meancon, summary->maxcon);
1049
            printf("Processing: " CONF_FMT_STRING, r->mind, r->meand, r->maxd);
1059
            printf("Processing: " CONF_FMT_STRING, summary->mind, summary->meand, summary->maxd);
1050
            printf("Waiting:    " CONF_FMT_STRING, r->minwait, r->meanwait, r->maxwait);
1060
            printf("Waiting:    " CONF_FMT_STRING, summary->minwait, summary->meanwait, summary->maxwait);
1051
            printf("Total:      " CONF_FMT_STRING, r->mintot, r->meantot, r->maxtot);
1061
            printf("Total:      " CONF_FMT_STRING, summary->mintot, summary->meantot, summary->maxtot);
1052
#undef CONF_FMT_STRING
1062
#undef CONF_FMT_STRING
1053
        }
1063
        }
1054
1064
1055
        if (!confidence) {
1065
        if (!confidence) {
1056
            qsort(stats, done, sizeof(struct data),
1066
            qsort(stats, done, sizeof(data_t),
1057
                  (int (*) (const void *, const void *)) comprando);
1067
                  (int (*) (const void *, const void *)) comprando);
1058
        }
1068
        }
1059
1069
Lines 1187-1213 Link Here
1187
1197
1188
    if (done > 0) { /* avoid division by zero (if 0 done) */
1198
    if (done > 0) { /* avoid division by zero (if 0 done) */
1189
        int i;
1199
        int i;
1190
        basic_stats_t *r = calculate_basic_results();
1191
1200
1201
        finalize_basic_results(summary);
1192
        printf("<tr %s><th %s colspan=4>Connection Times (ms)</th></tr>\n",
1202
        printf("<tr %s><th %s colspan=4>Connection Times (ms)</th></tr>\n",
1193
           trstring, tdstring);
1203
           trstring, tdstring);
1194
        if (confidence) {
1204
        if (confidence) {
1195
            confidence_stats_t *s = calculate_confidence_results(r);
1205
            confidence_stats_t *s = calculate_confidence_results(summary);
1196
            printf("<tr %s><th %s>&nbsp;</th><th %s>min</th><th %s>mean</th><th %s>+/-sd</th><th %s>median</th><th %s>max</th></tr>\n",
1206
            printf("<tr %s><th %s>&nbsp;</th><th %s>min</th><th %s>mean</th><th %s>+/-sd</th><th %s>median</th><th %s>max</th></tr>\n",
1197
               trstring, tdstring, tdstring, tdstring, tdstring, tdstring, tdstring);
1207
               trstring, tdstring, tdstring, tdstring, tdstring, tdstring, tdstring);
1198
#define CONF_FMT_STRING "<td %s>%5" APR_TIME_T_FMT "</td><td %s>%4" APR_TIME_T_FMT "</td><td %s>%5.1f</td><td %s>%6" APR_TIME_T_FMT "</td><td %s>%7" APR_TIME_T_FMT "</td></tr>\n"
1208
#define CONF_FMT_STRING "<td %s>%5" APR_TIME_T_FMT "</td><td %s>%4" APR_TIME_T_FMT "</td><td %s>%5.1f</td><td %s>%6" APR_TIME_T_FMT "</td><td %s>%7" APR_TIME_T_FMT "</td></tr>\n"
1199
            printf("<tr %s><th %s>Connect:</th>" CONF_FMT_STRING,
1209
            printf("<tr %s><th %s>Connect:</th>" CONF_FMT_STRING,
1200
               trstring, tdstring, tdstring, r->mincon, tdstring, r->meancon,
1210
               trstring, tdstring, tdstring, summary->mincon, tdstring, summary->meancon,
1201
               tdstring, s->sdcon, tdstring, s->mediancon, tdstring, r->maxcon);
1211
               tdstring, s->sdcon, tdstring, s->mediancon, tdstring, summary->maxcon);
1202
            printf("<tr %s><th %s>Processing:</th>" CONF_FMT_STRING,
1212
            printf("<tr %s><th %s>Processing:</th>" CONF_FMT_STRING,
1203
               trstring, tdstring, tdstring, r->mind, tdstring, r->meand,
1213
               trstring, tdstring, tdstring, summary->mind, tdstring, summary->meand,
1204
               tdstring, s->sdd, tdstring, s->mediand, tdstring, r->maxd);
1214
               tdstring, s->sdd, tdstring, s->mediand, tdstring, summary->maxd);
1205
            printf("<tr %s><th %s>Waiting:</th>" CONF_FMT_STRING,
1215
            printf("<tr %s><th %s>Waiting:</th>" CONF_FMT_STRING,
1206
               trstring, tdstring, tdstring, r->minwait, tdstring, r->meanwait,
1216
               trstring, tdstring, tdstring, summary->minwait, tdstring, summary->meanwait,
1207
               tdstring, s->sdwait, tdstring, s->medianwait, tdstring, r->maxwait);
1217
               tdstring, s->sdwait, tdstring, s->medianwait, tdstring, summary->maxwait);
1208
            printf("<tr %s><th %s>Total:</th>" CONF_FMT_STRING,
1218
            printf("<tr %s><th %s>Total:</th>" CONF_FMT_STRING,
1209
               trstring, tdstring, tdstring, r->mintot, tdstring, r->meantot,
1219
               trstring, tdstring, tdstring, summary->mintot, tdstring, summary->meantot,
1210
               tdstring, s->sdtot, tdstring, s->mediantot, tdstring, r->maxtot);
1220
               tdstring, s->sdtot, tdstring, s->mediantot, tdstring, summary->maxtot);
1211
#undef CONF_FMT_STRING
1221
#undef CONF_FMT_STRING
1212
1222
1213
#define     SANE(what,mean,median,sd) \
1223
#define     SANE(what,mean,median,sd) \
Lines 1223-1232 Link Here
1223
                       trstring, tdstring, "WARNING: The median and mean for " what " are not within a normal deviation " \
1233
                       trstring, tdstring, "WARNING: The median and mean for " what " are not within a normal deviation " \
1224
                                           "These results are probably not that reliable."); \
1234
                                           "These results are probably not that reliable."); \
1225
            }
1235
            }
1226
            SANE("the initial connection time", r->meancon, s->mediancon, s->sdcon);
1236
            SANE("the initial connection time", summary->meancon, s->mediancon, s->sdcon);
1227
            SANE("the processing time", r->meand, s->mediand, s->sdd);
1237
            SANE("the processing time", summary->meand, s->mediand, s->sdd);
1228
            SANE("the waiting time", r->meanwait, s->medianwait, s->sdwait);
1238
            SANE("the waiting time", summary->meanwait, s->medianwait, s->sdwait);
1229
            SANE("the total time", r->meantot, s->mediantot, s->sdtot);
1239
            SANE("the total time", summary->meantot, s->mediantot, s->sdtot);
1230
#undef SANE
1240
#undef SANE
1231
        }
1241
        }
1232
        else {
1242
        else {
Lines 1234-1251 Link Here
1234
               trstring, tdstring, tdstring, tdstring, tdstring);
1244
               trstring, tdstring, tdstring, tdstring, tdstring);
1235
#define CONF_FMT_STRING "<td %s>%5" APR_TIME_T_FMT "</td><td %s>%5" APR_TIME_T_FMT "</td><td %s>%5" APR_TIME_T_FMT "</td></tr>\n"
1245
#define CONF_FMT_STRING "<td %s>%5" APR_TIME_T_FMT "</td><td %s>%5" APR_TIME_T_FMT "</td><td %s>%5" APR_TIME_T_FMT "</td></tr>\n"
1236
            printf("<tr %s><th %s>Connect:</th>" CONF_FMT_STRING,
1246
            printf("<tr %s><th %s>Connect:</th>" CONF_FMT_STRING,
1237
               trstring, tdstring, tdstring, r->mincon, tdstring, r->meancon, tdstring, r->maxcon);
1247
               trstring, tdstring, tdstring, summary->mincon, tdstring, summary->meancon, tdstring, summary->maxcon);
1238
            printf("<tr %s><th %s>Processing:</th>" CONF_FMT_STRING,
1248
            printf("<tr %s><th %s>Processing:</th>" CONF_FMT_STRING,
1239
               trstring, tdstring, tdstring, r->mind, tdstring, r->meand, tdstring, r->maxd);
1249
               trstring, tdstring, tdstring, summary->mind, tdstring, summary->meand, tdstring, summary->maxd);
1240
            printf("<tr %s><th %s>Waiting:</th>" CONF_FMT_STRING,
1250
            printf("<tr %s><th %s>Waiting:</th>" CONF_FMT_STRING,
1241
               trstring, tdstring, tdstring, r->minwait, tdstring, r->meanwait, tdstring, r->maxwait);
1251
               trstring, tdstring, tdstring, summary->minwait, tdstring, summary->meanwait, tdstring, summary->maxwait);
1242
            printf("<tr %s><th %s>Total:</th>" CONF_FMT_STRING,
1252
            printf("<tr %s><th %s>Total:</th>" CONF_FMT_STRING,
1243
               trstring, tdstring, tdstring, r->mintot, tdstring, r->meantot, tdstring, r->maxtot);
1253
               trstring, tdstring, tdstring, summary->mintot, tdstring, summary->meantot, tdstring, summary->maxtot);
1244
#undef CONF_FMT_STRING
1254
#undef CONF_FMT_STRING
1245
        }
1255
        }
1246
1256
1247
        if (!confidence) {
1257
        if (!confidence) {
1248
            qsort(stats, done, sizeof(struct data),
1258
            qsort(stats, done, sizeof(data_t),
1249
                  (int (*) (const void *, const void *)) comprando);
1259
                  (int (*) (const void *, const void *)) comprando);
1250
        }
1260
        }
1251
1261
Lines 1416-1427 Link Here
1416
        }
1426
        }
1417
        /* save out time */
1427
        /* save out time */
1418
        if (done < requests) {
1428
        if (done < requests) {
1419
            struct data *s = &stats[done++];
1429
            data_t *s = &stats[done++];
1420
            c->done      = lasttime = apr_time_now();
1430
            c->done      = lasttime = apr_time_now();
1421
            s->starttime = c->start;
1431
            s->starttime = c->start;
1422
            s->ctime     = ap_max(0, c->connect - c->start);
1432
            s->ctime     = ap_max(0, c->connect - c->start);
1423
            s->time      = ap_max(0, c->done - c->start);
1433
            s->time      = ap_max(0, c->done - c->start);
1424
            s->waittime  = ap_max(0, c->beginread - c->endwrite);
1434
            s->waittime  = ap_max(0, c->beginread - c->endwrite);
1435
            increment_basic_results(summary, s);
1425
            if (heartbeatres && !(done % heartbeatres)) {
1436
            if (heartbeatres && !(done % heartbeatres)) {
1426
                fprintf(stderr, "Completed %d requests\n", done);
1437
                fprintf(stderr, "Completed %d requests\n", done);
1427
                fflush(stderr);
1438
                fflush(stderr);
Lines 1658-1670 Link Here
1658
            err_length++;
1669
            err_length++;
1659
        }
1670
        }
1660
        if (done < requests) {
1671
        if (done < requests) {
1661
            struct data *s = &stats[done++];
1672
            data_t *s = &stats[done++];
1662
            doneka++;
1673
            doneka++;
1663
            c->done      = apr_time_now();
1674
            c->done      = apr_time_now();
1664
            s->starttime = c->start;
1675
            s->starttime = c->start;
1665
            s->ctime     = ap_max(0, c->connect - c->start);
1676
            s->ctime     = ap_max(0, c->connect - c->start);
1666
            s->time      = ap_max(0, c->done - c->start);
1677
            s->time      = ap_max(0, c->done - c->start);
1667
            s->waittime  = ap_max(0, c->beginread - c->endwrite);
1678
            s->waittime  = ap_max(0, c->beginread - c->endwrite);
1679
            increment_basic_results(summary, s);
1668
            if (heartbeatres && !(done % heartbeatres)) {
1680
            if (heartbeatres && !(done % heartbeatres)) {
1669
                fprintf(stderr, "Completed %d requests\n", done);
1681
                fprintf(stderr, "Completed %d requests\n", done);
1670
                fflush(stderr);
1682
                fflush(stderr);
Lines 1716-1722 Link Here
1716
1728
1717
    con = calloc(concurrency, sizeof(struct connection));
1729
    con = calloc(concurrency, sizeof(struct connection));
1718
1730
1719
    stats = calloc(requests, sizeof(struct data));
1731
    stats = calloc(requests, sizeof(data_t));
1732
1733
    summary = calloc(1, sizeof(basic_stats_t));
1734
    init_basic_results(summary);
1720
1735
1721
    if ((status = apr_pollset_create(&readbits, concurrency, cntxt, 0)) != APR_SUCCESS) {
1736
    if ((status = apr_pollset_create(&readbits, concurrency, cntxt, 0)) != APR_SUCCESS) {
1722
        apr_err("apr_pollset_create failed", status);
1737
        apr_err("apr_pollset_create failed", status);

Return to bug 45356