make libfakebank scale
This commit is contained in:
parent
036e711779
commit
50749c462b
@ -67,4 +67,5 @@ libtalerfakebank_la_LIBADD = \
|
|||||||
-ljansson \
|
-ljansson \
|
||||||
$(LIBGNURLCURL_LIBS) \
|
$(LIBGNURLCURL_LIBS) \
|
||||||
-lmicrohttpd \
|
-lmicrohttpd \
|
||||||
|
-lpthread \
|
||||||
$(XLIB)
|
$(XLIB)
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -59,6 +59,7 @@ run (void *cls,
|
|||||||
const struct GNUNET_CONFIGURATION_Handle *cfg)
|
const struct GNUNET_CONFIGURATION_Handle *cfg)
|
||||||
{
|
{
|
||||||
unsigned long long port = 8082;
|
unsigned long long port = 8082;
|
||||||
|
unsigned long long ram = 1024 * 1024 * 128; /* 128 M entries */
|
||||||
char *currency_string;
|
char *currency_string;
|
||||||
|
|
||||||
(void) cls;
|
(void) cls;
|
||||||
@ -81,9 +82,20 @@ run (void *cls,
|
|||||||
"Listening on default port %llu\n",
|
"Listening on default port %llu\n",
|
||||||
port);
|
port);
|
||||||
}
|
}
|
||||||
|
if (GNUNET_OK !=
|
||||||
|
GNUNET_CONFIGURATION_get_value_number (cfg,
|
||||||
|
"bank",
|
||||||
|
"RAM_LIMIT",
|
||||||
|
&ram))
|
||||||
|
{
|
||||||
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
|
"Maximum transaction history in RAM set to default of %llu\n",
|
||||||
|
ram);
|
||||||
|
}
|
||||||
if (NULL ==
|
if (NULL ==
|
||||||
TALER_FAKEBANK_start2 ((uint16_t) port,
|
TALER_FAKEBANK_start2 ((uint16_t) port,
|
||||||
currency_string,
|
currency_string,
|
||||||
|
ram,
|
||||||
num_threads,
|
num_threads,
|
||||||
(0 != connection_close) ))
|
(0 != connection_close) ))
|
||||||
ret = 1;
|
ret = 1;
|
||||||
|
@ -64,6 +64,7 @@ TALER_FAKEBANK_start (uint16_t port,
|
|||||||
*
|
*
|
||||||
* @param port port to listen to
|
* @param port port to listen to
|
||||||
* @param currency which currency should the bank offer
|
* @param currency which currency should the bank offer
|
||||||
|
* @param ram_limit how much memory do we use at most
|
||||||
* @param num_threads size of the thread pool, 0 to use the GNUnet scheduler
|
* @param num_threads size of the thread pool, 0 to use the GNUnet scheduler
|
||||||
* @param close_connections true to force closing a connection after each request (no HTTP keep-alive)
|
* @param close_connections true to force closing a connection after each request (no HTTP keep-alive)
|
||||||
* @return NULL on error
|
* @return NULL on error
|
||||||
@ -71,6 +72,7 @@ TALER_FAKEBANK_start (uint16_t port,
|
|||||||
struct TALER_FAKEBANK_Handle *
|
struct TALER_FAKEBANK_Handle *
|
||||||
TALER_FAKEBANK_start2 (uint16_t port,
|
TALER_FAKEBANK_start2 (uint16_t port,
|
||||||
const char *currency,
|
const char *currency,
|
||||||
|
uint64_t ram_limit,
|
||||||
unsigned int num_threads,
|
unsigned int num_threads,
|
||||||
bool close_connections);
|
bool close_connections);
|
||||||
|
|
||||||
@ -81,6 +83,9 @@ TALER_FAKEBANK_start2 (uint16_t port,
|
|||||||
* or #TALER_FAKEBANK_check_credit()).
|
* or #TALER_FAKEBANK_check_credit()).
|
||||||
* If any transactions are onrecord, return #GNUNET_SYSERR.
|
* If any transactions are onrecord, return #GNUNET_SYSERR.
|
||||||
*
|
*
|
||||||
|
* Note that this function only works in
|
||||||
|
* single-threaded mode while nothing else is happening.
|
||||||
|
*
|
||||||
* @param h bank instance
|
* @param h bank instance
|
||||||
* @return #GNUNET_OK on success
|
* @return #GNUNET_OK on success
|
||||||
*/
|
*/
|
||||||
@ -139,6 +144,9 @@ TALER_FAKEBANK_make_admin_transfer (
|
|||||||
* to the transfer identifier and remove the transaction from the
|
* to the transfer identifier and remove the transaction from the
|
||||||
* list. If the transaction was not recorded, return #GNUNET_SYSERR.
|
* list. If the transaction was not recorded, return #GNUNET_SYSERR.
|
||||||
*
|
*
|
||||||
|
* Note that this function only works in
|
||||||
|
* single-threaded mode while nothing else is happening.
|
||||||
|
*
|
||||||
* @param h bank instance
|
* @param h bank instance
|
||||||
* @param want_amount transfer amount desired
|
* @param want_amount transfer amount desired
|
||||||
* @param want_debit account that should have been debited
|
* @param want_debit account that should have been debited
|
||||||
@ -162,6 +170,9 @@ TALER_FAKEBANK_check_debit (struct TALER_FAKEBANK_Handle *h,
|
|||||||
* @a want_credit account with the @a subject. If so, remove the transaction
|
* @a want_credit account with the @a subject. If so, remove the transaction
|
||||||
* from the list. If the transaction was not recorded, return #GNUNET_SYSERR.
|
* from the list. If the transaction was not recorded, return #GNUNET_SYSERR.
|
||||||
*
|
*
|
||||||
|
* Note that this function only works in
|
||||||
|
* single-threaded mode while nothing else is happening.
|
||||||
|
*
|
||||||
* @param h bank instance
|
* @param h bank instance
|
||||||
* @param want_amount transfer amount desired
|
* @param want_amount transfer amount desired
|
||||||
* @param want_debit account that should have been debited
|
* @param want_debit account that should have been debited
|
||||||
|
Loading…
Reference in New Issue
Block a user