|
@@ -20,41 +20,33 @@ struct t_stats *cur_stats, *acc_stats;
|
|
|
|
|
|
int print_stats( FILE *f )
|
|
|
{
|
|
|
- time_t now;
|
|
|
-
|
|
|
- time(&now);
|
|
|
-
|
|
|
- fprintf(f, "Time:\n----------------\n");
|
|
|
- fprintf(f, "Now: %s", ctime(&now));
|
|
|
- fprintf(f, "Up since: %s", ctime(&acc_stats->up_since));
|
|
|
- fprintf(f, "Up time: %.0f [sec]\n", difftime(now, acc_stats->up_since));
|
|
|
- fprintf(f, "\nCurrent values:\n----------------\n");
|
|
|
- fprintf(f, "# of transactions: %d\n",
|
|
|
+ fprintf(f, "Current:\n");
|
|
|
+ fprintf(f, "# of transactions: %d, ",
|
|
|
cur_stats->transactions );
|
|
|
- fprintf(f, " - local: %d\n",
|
|
|
+ fprintf(f, "local: %d, ",
|
|
|
cur_stats->client_transactions );
|
|
|
- fprintf(f, " - waiting: %d\n",
|
|
|
+ fprintf(f, "waiting: %d\n",
|
|
|
cur_stats->waiting );
|
|
|
|
|
|
- fprintf(f, "\nCummulative values:\n----------------\n");
|
|
|
- fprintf(f, "# of transactions: %d\n",
|
|
|
+ fprintf(f, "Total:\n");
|
|
|
+ fprintf(f, "# of transactions: %d,",
|
|
|
acc_stats->transactions );
|
|
|
- fprintf(f, " - local: %d\n",
|
|
|
+ fprintf(f, " local: %d,",
|
|
|
acc_stats->client_transactions );
|
|
|
- fprintf(f, " - waiting: %d\n",
|
|
|
+ fprintf(f, " waiting: %d\n",
|
|
|
acc_stats->waiting );
|
|
|
|
|
|
fprintf(f, "Replied localy: %d\n",
|
|
|
acc_stats->replied_localy );
|
|
|
- fprintf(f, "Completion status 6xx: %d\n",
|
|
|
+ fprintf(f, "Completion status 6xx: %d,",
|
|
|
acc_stats->completed_6xx );
|
|
|
- fprintf(f, "Completion status 5xx: %d\n",
|
|
|
+ fprintf(f, " 5xx: %d,",
|
|
|
acc_stats->completed_5xx );
|
|
|
- fprintf(f, "Completion status 4xx: %d\n",
|
|
|
+ fprintf(f, " 4xx: %d,",
|
|
|
acc_stats->completed_4xx );
|
|
|
- fprintf(f, "Completion status 3xx: %d\n",
|
|
|
+ fprintf(f, " 3xx: %d,",
|
|
|
acc_stats->completed_3xx );
|
|
|
- fprintf(f, "Completion status 2xx: %d\n",
|
|
|
+ fprintf(f, "2xx: %d\n",
|
|
|
acc_stats->completed_2xx );
|
|
|
|
|
|
return 1;
|
|
@@ -82,7 +74,7 @@ int static fifo_stats( FILE *pipe, char *response_file )
|
|
|
|
|
|
}
|
|
|
|
|
|
-int init_stats(void)
|
|
|
+int init_tm_stats(void)
|
|
|
{
|
|
|
cur_stats=shm_malloc(sizeof(struct t_stats));
|
|
|
if (cur_stats==0) {
|
|
@@ -103,6 +95,5 @@ int init_stats(void)
|
|
|
|
|
|
memset(cur_stats, 0, sizeof(struct t_stats) );
|
|
|
memset(acc_stats, 0, sizeof(struct t_stats) );
|
|
|
- time(&acc_stats->up_since);
|
|
|
return 1;
|
|
|
}
|