From 925097c86df2707a381d10c75445f57110b47d83 Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Mon, 30 May 2016 17:16:01 +0200 Subject: [PATCH] adding --pool-size option to benchmark, correcting comments --- src/benchmark/taler-exchange-benchmark | Bin 7584 -> 8756 bytes src/benchmark/taler-exchange-benchmark.c | 30 +++++++++++++++++++---- src/exchange-lib/exchange_api_reserve.c | 4 +-- src/include/taler_exchange_service.h | 4 +-- 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/benchmark/taler-exchange-benchmark b/src/benchmark/taler-exchange-benchmark index a106ecbc5c9fb6ed6272f363c5a1e4cebbdc0f76..336d9fcca30f879c34a155f3c713c411e561e4ca 100755 GIT binary patch literal 8756 zcmb7JdvH@%dOugXmIV^B{2VWE;!aIK)}9rI?CfoT!{rd9|>rWawQm$E0ILrft- z29f1b?*Tat`_s@dc09;@+_`d@4 zNAaRPlOAo)B-%3RY-u7|%tbp@-qfL3v2N3L{HuC0O$3o;HzBfbs1L_}efCce-{pNd z_0#(E6F)HK-E;O+>d-9NKBhY&B8GUkXC7tq5QB(o2LAQZ*>@h@`|LN~dGX&LxOd4v zOnn%7|Be3)L3LHAuR;;#-VtPQ)Zt*%{PCRQxkMV0)TiBXUf z%OK;4cq*1n+AI&njis|`Vd2kVRiwqvVlJz+T2gY-nTjNtEoE)zDkCL|mkM*Obi$66 zoDG`>Myzdp>j(O`4-IU!3Z*QI+!@Oj-2%Ia^G>Q@#}bv|;^bDLVZ&&6BAvBLMLU76 zfN9+Ait$)FD=a$^b7D}87K=&_Q8ppkQ@L@weLPl(+nG$RJ(G*aGMw3B-O%8gKC2U* z;0CTY24l|eMvl2siEui-fHU_`AY+(0Y5ILgcp0=7^a?2_IOa$#Cik|Qfs z3+v+8%5^9Gd1HeQ*0CH#x2*p=yy-`;=p z*D%~XvNg32`cxQyTkc7{jX65=1Z;mlc7nfSOIoKDr~c2>p}01#gvrak-PfOC#n6m; zls0*(DMdy30t@+Q`oxs;RdI$AY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ft! zcR7xwRe(kwx@Q-ph-JQ52mK29r;3IzRT?ELTP+6YEWrosR`D+QBV!V82>D25OrEdz z%d3^G*;G0li+4oTaTkV-2hrZ9`D_lMX`yu+L&->AIMm;liii@542MN3wlfk+E8g05 z>mOE~ZzW^t$Q|AO%s_~$CA&mADMH(#eX(H?N=4(zG&HgzG!zfRc_=KiFI%nYYu+lM3J0PK@OSqDlyo^9pk{-}`J1#1)zFUwS( z!7EaTg(Y06Fdt&<*b7ga-V$c{K`T@jJDy2wdI{rLpqVAi@|Az-k=j+6>&(B5@{HLe zs^aA_>zok1d@-Qe@rq-^3u8{r;cU^bhO)?`^ofuby=$U~Z16Gd? zPz}}tpvAZ~;T7Y+EchVG{s-(7^3agyln}D5w!9VhN2%%JKe_jTZWiW8L#e(1Y|5e9 zhU^veiX-qrc^kM`mo>~p8C?}dpu8TKr5{{GSR;bKe81t^g0x($rhcIXKv_J`Vg^{T zt8L{X30$1GfT+!iZ-b%UUQpnBn0H@s>8nMBcwvSCK}8Q{G$i@^gJl;v|;oIHBV5w1tBnA2qN;C0KdgU=(E06!=X z%xQ8m=3_uf`8p7%+=r9ylg*7@d3lc8V9pEWE!gp-@!y|zC0o_xcJi$Cg7dO`w5iFd z_6KeSUC9qMxee|pT^?;}aq={nCD{j%ssE_t709}$W(rJ2iy+Md)SnR1M_VlzYNSbjzS)g7XmHDo9Nw=&2zod-|R7dja%l=@;$#- zb^#s69rLb2gUudCFK(EaO+ME=*LVkaiAM=eHG6D-sg& #include + +static unsigned int pool_size = 100000; + /** * URI under which the exchange is reachable during the benchmark. */ #define EXCHANGE_URI "http://localhost:8081/" -/** - * Main function for the exchange's benchmark. +/** + * Main function that will be run by the scheduler. * - * @param argc expected to be 1 - * @param argv expected to only contain the program name + * @param cls closure */ +static void +run (void *cls) +{ +} + int main (int argc, char * const *argv) { - return GNUNET_OK; + /** + * 1 Pool's size as an option + * 2 Connection to the exchange + * 3 Allocation of large enough memory + * 4 Withdraw + */ + + const struct GNUNET_GETOPT_CommandLineOption options[] = { + {'s', "pool-size", NULL, + "How many coins this benchmark should instantiate", GNUNET_YES, + &GNUNET_GETOPT_set_uint, &pool_size} + }; + + GNUNET_SCHEDULER_run (&run, NULL); } diff --git a/src/exchange-lib/exchange_api_reserve.c b/src/exchange-lib/exchange_api_reserve.c index ab8733dbb..82e602a46 100644 --- a/src/exchange-lib/exchange_api_reserve.c +++ b/src/exchange-lib/exchange_api_reserve.c @@ -778,9 +778,9 @@ handle_reserve_withdraw_finished (void *cls, * @param exchange the exchange handle; the exchange must be ready to operate * @param pk kind of coin to create * @param reserve_priv private key of the reserve to withdraw from - * @param coin_priv where to store the coin's private key, + * @param coin_priv where to fetch the coin's private key, * caller must have committed this value to disk before the call (with @a pk) - * @param blinding_key where to store the coin's blinding key + * @param blinding_key where to fetch the coin's blinding key * caller must have committed this value to disk before the call (with @a pk) * @param res_cb the callback to call when the final result for this request is available * @param res_cb_cls closure for the above callback diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h index 62fc64b6f..1da42b897 100644 --- a/src/include/taler_exchange_service.h +++ b/src/include/taler_exchange_service.h @@ -719,9 +719,9 @@ typedef void * @param exchange the exchange handle; the exchange must be ready to operate * @param pk kind of coin to create * @param reserve_priv private key of the reserve to withdraw from - * @param coin_priv where to store the coin's private key, + * @param coin_priv where to fetch the coin's private key, * caller must have committed this value to disk before the call (with @a pk) - * @param blinding_key where to store the coin's blinding key + * @param blinding_key where to fetch the coin's blinding key * caller must have committed this value to disk before the call (with @a pk) * @param res_cb the callback to call when the final result for this request is available * @param res_cb_cls closure for @a res_cb