summaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-03-20 18:38:57 +0100
committerChristian Grothoff <christian@grothoff.org>2020-03-20 18:38:57 +0100
commit1b24e2f9bb84d64ff07f28a330e1913de790df0c (patch)
treea5290dc393dc2ef06ceb052c48a588e650c93b5e /src/testing
parentb9186bdd788b544fbbc349f655b93389fd301211 (diff)
downloadexchange-1b24e2f9bb84d64ff07f28a330e1913de790df0c.tar.gz
exchange-1b24e2f9bb84d64ff07f28a330e1913de790df0c.tar.bz2
exchange-1b24e2f9bb84d64ff07f28a330e1913de790df0c.zip
more statistics, make explicit table lock optional, can hurt performance badly
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/testing_api_cmd_auditor_deposit_confirmation.c7
-rw-r--r--src/testing/testing_api_cmd_auditor_exchanges.c3
-rw-r--r--src/testing/testing_api_cmd_bank_admin_add_incoming.c3
-rw-r--r--src/testing/testing_api_cmd_bank_transfer.c11
-rw-r--r--src/testing/testing_api_cmd_batch.c5
-rw-r--r--src/testing/testing_api_cmd_deposit.c3
-rw-r--r--src/testing/testing_api_cmd_refresh.c9
-rw-r--r--src/testing/testing_api_cmd_stat.c7
-rw-r--r--src/testing/testing_api_cmd_withdraw.c3
-rw-r--r--src/testing/testing_api_loop.c5
10 files changed, 48 insertions, 8 deletions
diff --git a/src/testing/testing_api_cmd_auditor_deposit_confirmation.c b/src/testing/testing_api_cmd_auditor_deposit_confirmation.c
index 9981bc59..b3ca4dd4 100644
--- a/src/testing/testing_api_cmd_auditor_deposit_confirmation.c
+++ b/src/testing/testing_api_cmd_auditor_deposit_confirmation.c
@@ -125,6 +125,8 @@ do_retry (void *cls)
struct DepositConfirmationState *dcs = cls;
dcs->retry_task = NULL;
+ dcs->is->commands[dcs->is->ip].last_req_time
+ = GNUNET_TIME_absolute_get ();
deposit_confirmation_run (dcs,
NULL,
dcs->is);
@@ -168,6 +170,7 @@ deposit_confirmation_cb (void *cls,
else
dcs->backoff = GNUNET_TIME_randomized_backoff (dcs->backoff,
MAX_BACKOFF);
+ dcs->is->commands[dcs->is->ip].num_tries++;
dcs->retry_task = GNUNET_SCHEDULER_add_delayed (dcs->backoff,
&do_retry,
dcs);
@@ -442,8 +445,8 @@ TALER_TESTING_cmd_deposit_confirmation (const char *label,
* @return the command with retries enabled
*/
struct TALER_TESTING_Command
-TALER_TESTING_cmd_deposit_confirmation_with_retry (struct TALER_TESTING_Command
- cmd)
+TALER_TESTING_cmd_deposit_confirmation_with_retry (
+ struct TALER_TESTING_Command cmd)
{
struct DepositConfirmationState *dcs;
diff --git a/src/testing/testing_api_cmd_auditor_exchanges.c b/src/testing/testing_api_cmd_auditor_exchanges.c
index 688d5830..4b143f10 100644
--- a/src/testing/testing_api_cmd_auditor_exchanges.c
+++ b/src/testing/testing_api_cmd_auditor_exchanges.c
@@ -115,6 +115,8 @@ do_retry (void *cls)
struct ExchangesState *es = cls;
es->retry_task = NULL;
+ es->is->commands[es->is->ip].last_req_time
+ = GNUNET_TIME_absolute_get ();
exchanges_run (es,
NULL,
es->is);
@@ -161,6 +163,7 @@ exchanges_cb (void *cls,
else
es->backoff = GNUNET_TIME_randomized_backoff (es->backoff,
MAX_BACKOFF);
+ es->is->commands[es->is->ip].num_tries++;
es->retry_task = GNUNET_SCHEDULER_add_delayed (es->backoff,
&do_retry,
es);
diff --git a/src/testing/testing_api_cmd_bank_admin_add_incoming.c b/src/testing/testing_api_cmd_bank_admin_add_incoming.c
index ddd27bab..cf90e50e 100644
--- a/src/testing/testing_api_cmd_bank_admin_add_incoming.c
+++ b/src/testing/testing_api_cmd_bank_admin_add_incoming.c
@@ -162,6 +162,8 @@ do_retry (void *cls)
struct AdminAddIncomingState *fts = cls;
fts->retry_task = NULL;
+ fts->is->commands[fts->is->ip].last_req_time
+ = GNUNET_TIME_absolute_get ();
admin_add_incoming_run (fts,
NULL,
fts->is);
@@ -214,6 +216,7 @@ confirmation_cb (void *cls,
else
fts->backoff = GNUNET_TIME_randomized_backoff (fts->backoff,
MAX_BACKOFF);
+ fts->is->commands[fts->is->ip].num_tries++;
fts->retry_task = GNUNET_SCHEDULER_add_delayed
(fts->backoff,
&do_retry,
diff --git a/src/testing/testing_api_cmd_bank_transfer.c b/src/testing/testing_api_cmd_bank_transfer.c
index 03bf5973..6da7c99b 100644
--- a/src/testing/testing_api_cmd_bank_transfer.c
+++ b/src/testing/testing_api_cmd_bank_transfer.c
@@ -149,6 +149,8 @@ do_retry (void *cls)
struct TransferState *fts = cls;
fts->retry_task = NULL;
+ fts->is->commands[fts->is->ip].last_req_time
+ = GNUNET_TIME_absolute_get ();
transfer_run (fts,
NULL,
fts->is);
@@ -197,10 +199,11 @@ confirmation_cb (void *cls,
fts->backoff = GNUNET_TIME_UNIT_ZERO;
else
fts->backoff = EXCHANGE_LIB_BACKOFF (fts->backoff);
- fts->retry_task = GNUNET_SCHEDULER_add_delayed
- (fts->backoff,
- &do_retry,
- fts);
+ fts->is->commands[fts->is->ip].num_tries++;
+ fts->retry_task
+ = GNUNET_SCHEDULER_add_delayed (fts->backoff,
+ &do_retry,
+ fts);
return;
}
}
diff --git a/src/testing/testing_api_cmd_batch.c b/src/testing/testing_api_cmd_batch.c
index ebb4e6d9..5de923f7 100644
--- a/src/testing/testing_api_cmd_batch.c
+++ b/src/testing/testing_api_cmd_batch.c
@@ -70,7 +70,10 @@ batch_run (void *cls,
TALER_TESTING_interpreter_next (is);
return;
}
- bs->batch[bs->batch_ip].start_time = GNUNET_TIME_absolute_get ();
+ bs->batch[bs->batch_ip].start_time
+ = bs->batch[bs->batch_ip].last_req_time
+ = GNUNET_TIME_absolute_get ();
+ bs->batch[bs->batch_ip].num_tries = 1;
bs->batch[bs->batch_ip].run (bs->batch[bs->batch_ip].cls,
&bs->batch[bs->batch_ip],
is);
diff --git a/src/testing/testing_api_cmd_deposit.c b/src/testing/testing_api_cmd_deposit.c
index 6404a94a..7e97f544 100644
--- a/src/testing/testing_api_cmd_deposit.c
+++ b/src/testing/testing_api_cmd_deposit.c
@@ -164,6 +164,8 @@ do_retry (void *cls)
struct DepositState *ds = cls;
ds->retry_task = NULL;
+ ds->is->commands[ds->is->ip].last_req_time
+ = GNUNET_TIME_absolute_get ();
deposit_run (ds,
NULL,
ds->is);
@@ -213,6 +215,7 @@ deposit_cb (void *cls,
else
ds->backoff = GNUNET_TIME_randomized_backoff (ds->backoff,
MAX_BACKOFF);
+ ds->is->commands[ds->is->ip].num_tries++;
ds->retry_task
= GNUNET_SCHEDULER_add_delayed (ds->backoff,
&do_retry,
diff --git a/src/testing/testing_api_cmd_refresh.c b/src/testing/testing_api_cmd_refresh.c
index 51c3890b..f290a5ad 100644
--- a/src/testing/testing_api_cmd_refresh.c
+++ b/src/testing/testing_api_cmd_refresh.c
@@ -315,6 +315,8 @@ do_reveal_retry (void *cls)
struct RefreshRevealState *rrs = cls;
rrs->retry_task = NULL;
+ rrs->is->commands[rrs->is->ip].last_req_time
+ = GNUNET_TIME_absolute_get ();
refresh_reveal_run (rrs,
NULL,
rrs->is);
@@ -372,6 +374,7 @@ reveal_cb (void *cls,
MAX_BACKOFF);
rrs->total_backoff = GNUNET_TIME_relative_add (rrs->total_backoff,
rrs->backoff);
+ rrs->is->commands[rrs->is->ip].num_tries++;
rrs->retry_task = GNUNET_SCHEDULER_add_delayed (rrs->backoff,
&do_reveal_retry,
rrs);
@@ -545,6 +548,8 @@ do_link_retry (void *cls)
struct RefreshLinkState *rls = cls;
rls->retry_task = NULL;
+ rls->is->commands[rls->is->ip].last_req_time
+ = GNUNET_TIME_absolute_get ();
refresh_link_run (rls,
NULL,
rls->is);
@@ -610,6 +615,7 @@ link_cb (void *cls,
MAX_BACKOFF);
rls->total_backoff = GNUNET_TIME_relative_add (rls->total_backoff,
rls->backoff);
+ rls->is->commands[rls->is->ip].num_tries++;
rls->retry_task = GNUNET_SCHEDULER_add_delayed (rls->backoff,
&do_link_retry,
rls);
@@ -853,6 +859,8 @@ do_melt_retry (void *cls)
struct RefreshMeltState *rms = cls;
rms->retry_task = NULL;
+ rms->is->commands[rms->is->ip].last_req_time
+ = GNUNET_TIME_absolute_get ();
melt_run (rms,
NULL,
rms->is);
@@ -904,6 +912,7 @@ melt_cb (void *cls,
MAX_BACKOFF);
rms->total_backoff = GNUNET_TIME_relative_add (rms->total_backoff,
rms->backoff);
+ rms->is->commands[rms->is->ip].num_tries++;
rms->retry_task = GNUNET_SCHEDULER_add_delayed
(rms->backoff,
&do_melt_retry,
diff --git a/src/testing/testing_api_cmd_stat.c b/src/testing/testing_api_cmd_stat.c
index 3640490c..cf6d0b48 100644
--- a/src/testing/testing_api_cmd_stat.c
+++ b/src/testing/testing_api_cmd_stat.c
@@ -79,6 +79,7 @@ stat_cmd (struct TALER_TESTING_Timer *timings,
const struct TALER_TESTING_Command *cmd)
{
struct GNUNET_TIME_Relative duration;
+ struct GNUNET_TIME_Relative lat;
if (cmd->start_time.abs_value_us > cmd->finish_time.abs_value_us)
{
@@ -87,6 +88,8 @@ stat_cmd (struct TALER_TESTING_Timer *timings,
}
duration = GNUNET_TIME_absolute_get_difference (cmd->start_time,
cmd->finish_time);
+ lat = GNUNET_TIME_absolute_get_difference (cmd->last_req_time,
+ cmd->finish_time);
for (unsigned int i = 0;
NULL != timings[i].prefix;
i++)
@@ -98,7 +101,11 @@ stat_cmd (struct TALER_TESTING_Timer *timings,
timings[i].total_duration
= GNUNET_TIME_relative_add (duration,
timings[i].total_duration);
+ timings[i].success_latency
+ = GNUNET_TIME_relative_add (lat,
+ timings[i].success_latency);
timings[i].num_commands++;
+ timings[i].num_retries += cmd->num_tries;
break;
}
}
diff --git a/src/testing/testing_api_cmd_withdraw.c b/src/testing/testing_api_cmd_withdraw.c
index 1ef341e0..8ecf5201 100644
--- a/src/testing/testing_api_cmd_withdraw.c
+++ b/src/testing/testing_api_cmd_withdraw.c
@@ -152,6 +152,8 @@ do_retry (void *cls)
struct WithdrawState *ws = cls;
ws->retry_task = NULL;
+ ws->is->commands[ws->is->ip].last_req_time
+ = GNUNET_TIME_absolute_get ();
withdraw_run (ws,
NULL,
ws->is);
@@ -208,6 +210,7 @@ reserve_withdraw_cb (void *cls,
UNKNOWN_MAX_BACKOFF);
ws->total_backoff = GNUNET_TIME_relative_add (ws->total_backoff,
ws->backoff);
+ ws->is->commands[ws->is->ip].num_tries++;
ws->retry_task = GNUNET_SCHEDULER_add_delayed (ws->backoff,
&do_retry,
ws);
diff --git a/src/testing/testing_api_loop.c b/src/testing/testing_api_loop.c
index 33b5cf07..4e139917 100644
--- a/src/testing/testing_api_loop.c
+++ b/src/testing/testing_api_loop.c
@@ -272,7 +272,10 @@ interpreter_run (void *cls)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Running command `%s'\n",
cmd->label);
- cmd->start_time = GNUNET_TIME_absolute_get ();
+ cmd->start_time
+ = cmd->last_req_time
+ = GNUNET_TIME_absolute_get ();
+ cmd->num_tries = 1;
cmd->run (cmd->cls,
cmd,
is);