diff --git a/priv/perf/README.md b/priv/perf/README.md index 94f2d81e56..a1496fb2fb 100644 --- a/priv/perf/README.md +++ b/priv/perf/README.md @@ -2,14 +2,89 @@ Umbrella app for performance/load/stress tests -## How to run the test -1. Change the urls inside the [config files](config/) for the environment you are targeting. -1. To generate the open-api client (only need once): `make init` -1. To run the test: `MIX_ENV= mix test`. Or `mix test` if you want to run against local services. +## How to run the tests -### Spin up local services for development -1. To test with local services (by docker-compose): `make start-services` -1. To turn the local services down: `make stop-services` +### 1. Set up the environment vars + +``` +export CHILD_CHAIN_URL= +export WATCHER_INFO_URL= +export ETHEREUM_RPC_URL= +export CONTRACT_ADDRESS_PLASMA_FRAMEWORK=
+export CONTRACT_ADDRESS_ETH_VAULT=
+export CONTRACT_ADDRESS_ERC20_VAULT=
+export LOAD_TEST_FAUCET_PRIVATE_KEY= +``` + + +### 2. Generate the open-api client + ``` +make init +``` + +### 3. Configure the tests +Edit the config file (e.g. `config/dev.exs`) set the test parameters e.g. +``` + childchain_transactions_test_config: %{ + concurrent_sessions: 100, + transactions_per_session: 600, + transaction_delay: 1000 + } +``` + +Note that by default the tests use ETH both as the currency spent and as the fee. +This makes the code simpler as it doesn't have to manage separate fee utxos. +However, if necessary you can configure the tests to use a different currency. e.g. +``` +config :load_test, + test_currency: "0x942f123b3587EDe66193aa52CF2bF9264C564F87", + fee_amount: 6_000_000_000_000_000, +``` + +### 4. Run the tests +``` +MIX_ENV= mix test +``` + +Or just `mix test` if you want to run against local services. + +You can specify a particular test on the command line e.g. + +``` +MIX_ENV=dev mix test apps/load_test/test/load_tests/runner/childchain_test.exs +``` + +**Important** After each test run, you need to wait ~15 seconds before running it again. +This is necessary to wait for the faucet account's utxos to be spendable. +Depending on the watcher-info load, it can take longer than this. + +If you get an error like this +``` +module=LoadTest.Service.Faucet Funding user 0x76f0a3aade31c19d306bc91b46817b95072a8cbd with 2 from utxo: 10800070000⋅ +module=LoadTest.ChildChain.Transaction Transaction submission has failed, reason: "submit:utxo_not_found"⋅ +``` + +then you haven't waited long enough. +Kill it, wait some more, try again. ### Increase connection pool size and connection -One can override the setup in config to increase the `pool_size` and `max_connection`. If you found the latency on the api calls are high but the data dog latency shows way smaller, it might be latency from setting up the connection instead of real api latency. +One can override the setup in config to increase the `pool_size` and `max_connection`. +If you found the latency on the api calls are high but the data dog latency shows way smaller, +it might be latency from setting up the connection instead of real api latency. + +### Retrying on errors +The Tesla HTTP middleware can be configured to retry on error. +By default this is disabled, but it can be enabled by modifying the `retry?` function in `connection_defaults.ex`. + +For example, to retry any 500 response: +``` + defp retry?() do + fn + {:ok, %{status: status}} when status in 500..599 -> true + {:ok, _} -> false + {:error, _} -> false + end + end +``` + +See [Tesla.Middleware.Retry](https://hexdocs.pm/tesla/Tesla.Middleware.Retry.html) for more details. \ No newline at end of file diff --git a/priv/perf/apps/load_test/lib/application.ex b/priv/perf/apps/load_test/lib/application.ex index 56bd147e0f..e2215978e0 100644 --- a/priv/perf/apps/load_test/lib/application.ex +++ b/priv/perf/apps/load_test/lib/application.ex @@ -12,6 +12,7 @@ defmodule LoadTest.Application do :hackney_pool.start_pool( LoadTest.Connection.ConnectionDefaults.pool_name(), timeout: 180_000, + connect_timeout: 30_000, pool_size: pool_size, max_connections: max_connections ) @@ -30,8 +31,8 @@ defmodule LoadTest.Application do defp fetch_faucet_config() do faucet_config_keys = [ :faucet_private_key, - :fee_wei, - :faucet_deposit_wei, + :fee_amount, + :faucet_deposit_amount, :deposit_finality_margin, :gas_price ] diff --git a/priv/perf/apps/load_test/lib/child_chain/deposit.ex b/priv/perf/apps/load_test/lib/child_chain/deposit.ex index ebb4ab6f86..33fa810fa3 100644 --- a/priv/perf/apps/load_test/lib/child_chain/deposit.ex +++ b/priv/perf/apps/load_test/lib/child_chain/deposit.ex @@ -26,7 +26,21 @@ defmodule LoadTest.ChildChain.Deposit do @eth <<0::160>> @poll_interval 5_000 + @doc """ + Deposits funds into the childchain. + If currency is ETH, funds will be deposited into the EthVault. + If currency is ERC20, 'approve()' will be called before depositing funds into the Erc20Vault. + + Returns the utxo created by the deposit. + """ + @spec deposit_from( + LoadTest.Ethereum.Account.t(), + pos_integer(), + LoadTest.Ethereum.Account.t(), + pos_integer(), + pos_integer() + ) :: Utxo.t() def deposit_from(%Account{} = depositor, amount, currency, deposit_finality_margin, gas_price) do deposit_utxo = %Utxo{amount: amount, owner: depositor.addr, currency: currency} {:ok, deposit} = Deposit.new(deposit_utxo) @@ -36,15 +50,29 @@ defmodule LoadTest.ChildChain.Deposit do end defp send_deposit(deposit, account, value, @eth, gas_price) do - eth_vault_address = Application.fetch_env!(:load_test, :eth_vault_address) + vault_address = Application.fetch_env!(:load_test, :eth_vault_address) + do_deposit(vault_address, deposit, account, value, gas_price) + end + + defp send_deposit(deposit, account, value, erc20_contract, gas_price) do + vault_address = Application.fetch_env!(:load_test, :erc20_vault_address) + + # First have to approve the token + {:ok, tx_hash} = approve(erc20_contract, vault_address, account, value, gas_price) + {:ok, _} = Ethereum.transact_sync(tx_hash) + + # Note that when depositing erc20 tokens, then tx value must be 0 + do_deposit(vault_address, deposit, account, 0, gas_price) + end + + defp do_deposit(vault_address, deposit, account, value, gas_price) do %{data: deposit_data} = LoadTest.Utils.Encoding.encode_deposit(deposit) tx = %LoadTest.Ethereum.Transaction{ - to: Encoding.to_binary(eth_vault_address), + to: Encoding.to_binary(vault_address), value: value, gas_price: gas_price, gas_limit: 200_000, - init: <<>>, data: Encoding.to_binary(deposit_data) } @@ -53,14 +81,10 @@ defmodule LoadTest.ChildChain.Deposit do {:ok, %{"logs" => logs}} = Ethereumex.HttpClient.eth_get_transaction_receipt(tx_hash) - deposit_blknum = - logs - |> Enum.map(fn %{"topics" => topics} -> topics end) - |> Enum.map(fn [_topic, _addr, blknum | _] -> blknum end) - |> hd() - |> Encoding.to_int() + %{"topics" => [_topic, _addr, blknum | _]} = + Enum.find(logs, fn %{"address" => address} -> address == vault_address end) - {:ok, {deposit_blknum, eth_blknum}} + {:ok, {Encoding.to_int(blknum), eth_blknum}} end defp wait_deposit_finality(deposit_eth_blknum, finality_margin) do @@ -75,4 +99,17 @@ defmodule LoadTest.ChildChain.Deposit do wait_deposit_finality(deposit_eth_blknum, finality_margin) end end + + defp approve(contract, vault_address, account, value, gas_price) do + data = ABI.encode("approve(address,uint256)", [Encoding.to_binary(vault_address), value]) + + tx = %LoadTest.Ethereum.Transaction{ + to: contract, + gas_price: gas_price, + gas_limit: 200_000, + data: data + } + + Ethereum.send_raw_transaction(tx, account) + end end diff --git a/priv/perf/apps/load_test/lib/child_chain/transaction.ex b/priv/perf/apps/load_test/lib/child_chain/transaction.ex index 34471ec468..ad40916b91 100644 --- a/priv/perf/apps/load_test/lib/child_chain/transaction.ex +++ b/priv/perf/apps/load_test/lib/child_chain/transaction.ex @@ -25,7 +25,6 @@ defmodule LoadTest.ChildChain.Transaction do alias LoadTest.Connection.ChildChain, as: Connection @retry_interval 1_000 - @eth <<0::160>> @doc """ Spends a utxo. @@ -46,20 +45,28 @@ defmodule LoadTest.ChildChain.Transaction do Utxo.address_binary(), pos_integer() ) :: list(Utxo.t()) - def spend_utxo(utxo, amount, fee, signer, receiver, currency \\ @eth, retries \\ 0) do + def spend_utxo(utxo, amount, fee, signer, receiver, currency, retries \\ 0) + + def spend_utxo(utxo, amount, fee, signer, receiver, currency, retries) when byte_size(currency) == 20 do change_amount = utxo.amount - amount - fee receiver_output = %Utxo{owner: receiver.addr, currency: currency, amount: amount} - do_spend(utxo, receiver_output, change_amount, signer, retries) + do_spend(utxo, receiver_output, change_amount, currency, signer, retries) end - defp do_spend(_input, _output, change_amount, _signer, _retries) when change_amount < 0, do: :error_insufficient_funds + def spend_utxo(utxo, amount, fee, signer, receiver, currency, retries) do + spend_utxo(utxo, amount, fee, signer, receiver, Encoding.to_binary(currency), retries) + end - defp do_spend(input, output, 0, signer, retries) do + defp do_spend(_input, _output, change_amount, _currency, _signer, _retries) when change_amount < 0 do + :error_insufficient_funds + end + + defp do_spend(input, output, 0, _currency, signer, retries) do submit_tx([input], [output], [signer], retries) end - defp do_spend(input, output, change_amount, signer, retries) do - change_output = %Utxo{owner: signer.addr, currency: @eth, amount: change_amount} + defp do_spend(input, output, change_amount, currency, signer, retries) do + change_output = %Utxo{owner: signer.addr, currency: currency, amount: change_amount} submit_tx([input], [change_output, output], [signer], retries) end @@ -125,7 +132,9 @@ defmodule LoadTest.ChildChain.Transaction do {:ok, blknum, txindex} %{"code" => reason} -> - _ = Logger.warn("Transaction submission has failed, reason: #{inspect(reason)}") + _ = + Logger.warn("Transaction submission has failed, reason: #{inspect(reason)}, tx inputs: #{inspect(tx.inputs)}") + {:error, reason} end end diff --git a/priv/perf/apps/load_test/lib/connection/connection_defaults.ex b/priv/perf/apps/load_test/lib/connection/connection_defaults.ex index 78d256c3c6..1076e7c247 100644 --- a/priv/perf/apps/load_test/lib/connection/connection_defaults.ex +++ b/priv/perf/apps/load_test/lib/connection/connection_defaults.ex @@ -34,11 +34,12 @@ defmodule LoadTest.Connection.ConnectionDefaults do """ def pool_name(), do: :perf_pool + # Don't automatically retry on error + # It _can_ sometimes be useful to retry though, so if you need it return true here + # See README.md for more info defp retry?() do fn - {:ok, %{status: status}} when status in 500..599 -> true - {:ok, _} -> false - {:error, _} -> true + _ -> false end end end diff --git a/priv/perf/apps/load_test/lib/runner/childchain.ex b/priv/perf/apps/load_test/lib/runner/childchain.ex index df611c2e65..ae5a3f9e59 100644 --- a/priv/perf/apps/load_test/lib/runner/childchain.ex +++ b/priv/perf/apps/load_test/lib/runner/childchain.ex @@ -43,7 +43,8 @@ defmodule LoadTest.Runner.ChildChainTransactions do end def scenarios() do - fee_wei = Application.fetch_env!(:load_test, :fee_wei) + test_currency = Application.fetch_env!(:load_test, :test_currency) + fee_amount = Application.fetch_env!(:load_test, :fee_amount) config = default_config() {:ok, sender} = Account.new() @@ -52,7 +53,7 @@ defmodule LoadTest.Runner.ChildChainTransactions do amount = 1 ntx_to_send = config.transactions_per_session - initial_funds = (amount + fee_wei) * ntx_to_send + initial_funds = (amount + fee_amount) * ntx_to_send [ {{config.concurrent_sessions, [LoadTest.Scenario.FundAccount, LoadTest.Scenario.SpendEthUtxo]}, @@ -61,7 +62,8 @@ defmodule LoadTest.Runner.ChildChainTransactions do initial_funds: initial_funds, sender: sender, receiver: receiver, - amount: amount + amount: amount, + test_currency: test_currency }} ] end diff --git a/priv/perf/apps/load_test/lib/scenario/account_transactions.ex b/priv/perf/apps/load_test/lib/scenario/account_transactions.ex index e765f19242..fd0389d8b3 100644 --- a/priv/perf/apps/load_test/lib/scenario/account_transactions.ex +++ b/priv/perf/apps/load_test/lib/scenario/account_transactions.ex @@ -44,9 +44,9 @@ defmodule LoadTest.Scenario.AccountTransactions do def run(session) do iterations = config(session, [:iterations]) - fee_wei = Application.fetch_env!(:load_test, :fee_wei) + fee_amount = Application.fetch_env!(:load_test, :fee_amount) - amount = iterations * (@test_output_amount + fee_wei) + amount = iterations * (@test_output_amount + fee_amount) {:ok, sender} = Account.new() {:ok, _} = Faucet.fund_child_chain_account(sender, amount, @eth) diff --git a/priv/perf/apps/load_test/lib/scenario/create_utxos.ex b/priv/perf/apps/load_test/lib/scenario/create_utxos.ex index af5d839083..136f73a783 100644 --- a/priv/perf/apps/load_test/lib/scenario/create_utxos.ex +++ b/priv/perf/apps/load_test/lib/scenario/create_utxos.ex @@ -26,49 +26,59 @@ defmodule LoadTest.Scenario.CreateUtxos do alias Chaperon.Session alias ExPlasma.Utxo - @eth <<0::160>> @spawned_outputs_per_transaction 3 @spec run(Session.t()) :: Session.t() def run(session) do - fee_wei = Application.fetch_env!(:load_test, :fee_wei) - session = Session.assign(session, fee_wei: fee_wei) + fee_amount = Application.fetch_env!(:load_test, :fee_amount) + session = Session.assign(session, fee_amount: fee_amount) + test_currency = Application.fetch_env!(:load_test, :test_currency) + session = Session.assign(session, test_currency: test_currency) sender = config(session, [:sender]) utxos_to_create_per_session = config(session, [:utxos_to_create_per_session]) number_of_transactions = div(utxos_to_create_per_session, 3) transactions_per_session = config(session, [:transactions_per_session]) - min_final_change = transactions_per_session * fee_wei + 1 + min_final_change = transactions_per_session * fee_amount + 1 - amount_per_utxo = get_amount_per_created_utxo(fee_wei) - initial_funds = number_of_transactions * fee_wei + utxos_to_create_per_session * amount_per_utxo + min_final_change + amount_per_utxo = get_amount_per_created_utxo(fee_amount) + + initial_funds = + number_of_transactions * fee_amount + utxos_to_create_per_session * amount_per_utxo + min_final_change session |> run_scenario(LoadTest.Scenario.FundAccount, %{ account: sender, - initial_funds: initial_funds + initial_funds: initial_funds, + test_currency: test_currency }) |> repeat(:submit_transaction, [sender], number_of_transactions) end def submit_transaction(session, sender) do - {inputs, outputs} = create_transaction(sender, session.assigned.utxo, session.assigned.fee_wei) + {inputs, outputs} = + create_transaction( + sender, + session.assigned.utxo, + session.assigned.test_currency, + session.assigned.fee_amount + ) new_outputs = LoadTest.ChildChain.Transaction.submit_tx(inputs, outputs, [sender]) Session.assign(session, utxo: List.last(new_outputs)) end - defp create_transaction(sender, input, fee_wei) do - amount_per_utxo = get_amount_per_created_utxo(fee_wei) - change = input.amount - @spawned_outputs_per_transaction * amount_per_utxo - fee_wei + defp create_transaction(sender, input, currency, fee_amount) do + amount_per_utxo = get_amount_per_created_utxo(fee_amount) + change = input.amount - @spawned_outputs_per_transaction * amount_per_utxo - fee_amount - created_output = %Utxo{owner: sender.addr, currency: @eth, amount: amount_per_utxo} - change_output = %Utxo{owner: sender.addr, currency: @eth, amount: change} + created_output = %Utxo{owner: sender.addr, currency: currency, amount: amount_per_utxo} + change_output = %Utxo{owner: sender.addr, currency: currency, amount: change} {[input], List.duplicate(created_output, @spawned_outputs_per_transaction) ++ [change_output]} end - defp get_amount_per_created_utxo(fee_wei), do: fee_wei + 2 + defp get_amount_per_created_utxo(fee_amount), do: fee_amount + 2 end diff --git a/priv/perf/apps/load_test/lib/scenario/fund_account.ex b/priv/perf/apps/load_test/lib/scenario/fund_account.ex index 9f6208e88f..1606de53cb 100644 --- a/priv/perf/apps/load_test/lib/scenario/fund_account.ex +++ b/priv/perf/apps/load_test/lib/scenario/fund_account.ex @@ -27,13 +27,12 @@ defmodule LoadTest.Scenario.FundAccount do alias Chaperon.Session alias LoadTest.Service.Faucet - @eth <<0::160>> - @spec run(Session.t()) :: Session.t() def run(session) do account = config(session, [:account]) initial_funds = config(session, [:initial_funds]) - {:ok, utxo} = Faucet.fund_child_chain_account(account, initial_funds, @eth) + test_currency = config(session, [:test_currency]) + {:ok, utxo} = Faucet.fund_child_chain_account(account, initial_funds, test_currency) Session.assign(session, utxo: utxo) end diff --git a/priv/perf/apps/load_test/lib/scenario/spend_eth_utxo.ex b/priv/perf/apps/load_test/lib/scenario/spend_eth_utxo.ex index 0520c7365b..79d5db1b82 100644 --- a/priv/perf/apps/load_test/lib/scenario/spend_eth_utxo.ex +++ b/priv/perf/apps/load_test/lib/scenario/spend_eth_utxo.ex @@ -35,29 +35,35 @@ defmodule LoadTest.Scenario.SpendEthUtxo do alias Chaperon.Timing def run(session) do - fee_wei = Application.fetch_env!(:load_test, :fee_wei) + fee_amount = Application.fetch_env!(:load_test, :fee_amount) sender = config(session, [:sender]) receiver = config(session, [:receiver]) amount = config(session, [:amount], nil) + test_currency = config(session, [:test_currency], nil) delay = config(session, [:transaction_delay], 0) transactions_per_session = config(session, [:transactions_per_session]) - repeat(session, :submit_transaction, [amount, fee_wei, sender, receiver, delay], transactions_per_session) + repeat( + session, + :submit_transaction, + [amount, fee_amount, sender, receiver, test_currency, delay], + transactions_per_session + ) end - def submit_transaction(session, nil, fee_wei, sender, receiver, delay) do + def submit_transaction(session, nil, fee_amount, sender, receiver, currency, delay) do utxo = session.assigned.utxo - amount = utxo.amount - fee_wei - submit_transaction(session, amount, fee_wei, sender, receiver, delay) + amount = utxo.amount - fee_amount + submit_transaction(session, amount, fee_amount, sender, receiver, currency, delay) end - def submit_transaction(session, amount, fee_wei, sender, receiver, delay) do + def submit_transaction(session, amount, fee_amount, sender, receiver, currency, delay) do Process.sleep(delay) utxo = session.assigned.utxo start = Timing.timestamp() - [next_utxo | _] = LoadTest.ChildChain.Transaction.spend_utxo(utxo, amount, fee_wei, sender, receiver) + [next_utxo | _] = LoadTest.ChildChain.Transaction.spend_utxo(utxo, amount, fee_amount, sender, receiver, currency) session |> Session.assign(utxo: next_utxo) diff --git a/priv/perf/apps/load_test/lib/service/faucet.ex b/priv/perf/apps/load_test/lib/service/faucet.ex index b3cc31a513..1e99dde1c0 100644 --- a/priv/perf/apps/load_test/lib/service/faucet.ex +++ b/priv/perf/apps/load_test/lib/service/faucet.ex @@ -44,27 +44,29 @@ defmodule LoadTest.Service.Faucet do # allow the faucet to retry to avoid failing the test prematurely. @fund_child_chain_account_retries 100 - @eth <<0::160>> - @type state :: %__MODULE__{ faucet_account: Account.t(), fee: pos_integer(), - faucet_deposit_wei: pos_integer(), + faucet_deposit_amount: pos_integer(), deposit_finality_margin: pos_integer(), gas_price: pos_integer(), utxos: map() } - defstruct [:faucet_account, :fee, :faucet_deposit_wei, :deposit_finality_margin, :gas_price, utxos: %{}] + defstruct [:faucet_account, :fee, :faucet_deposit_amount, :deposit_finality_margin, :gas_price, utxos: %{}] @doc """ Sends funds to an account on the childchain. If the faucet doesn't have enough funds it will deposit more. Note that this can take some time to finalize. """ @spec fund_child_chain_account(Account.t(), pos_integer(), Utxo.address_binary()) :: Utxo.t() - def fund_child_chain_account(receiver, amount, currency) do + def fund_child_chain_account(receiver, amount, currency) when byte_size(currency) == 20 do GenServer.call(__MODULE__, {:fund_child_chain, receiver, amount, currency}, :infinity) end + def fund_child_chain_account(receiver, amount, currency) do + fund_child_chain_account(receiver, amount, Encoding.to_binary(currency)) + end + @doc """ Returns the faucet account. """ @@ -97,8 +99,8 @@ defmodule LoadTest.Service.Faucet do struct!( __MODULE__, faucet_account: faucet_account, - fee: Keyword.fetch!(config, :fee_wei), - faucet_deposit_wei: Keyword.fetch!(config, :faucet_deposit_wei), + fee: Keyword.fetch!(config, :fee_amount), + faucet_deposit_amount: Keyword.fetch!(config, :faucet_deposit_amount), deposit_finality_margin: Keyword.fetch!(config, :deposit_finality_margin), gas_price: Keyword.fetch!(config, :gas_price) ) @@ -122,7 +124,7 @@ defmodule LoadTest.Service.Faucet do state.fee, state.faucet_account, receiver, - @eth, + currency, @fund_child_chain_account_retries ) @@ -151,7 +153,7 @@ defmodule LoadTest.Service.Faucet do if utxo == nil or utxo.amount - amount - state.fee < 0 do deposit( state.faucet_account, - max(state.faucet_deposit_wei, amount + state.fee), + max(state.faucet_deposit_amount, amount + state.fee), currency, state.deposit_finality_margin, state.gas_price diff --git a/priv/perf/config/config.exs b/priv/perf/config/config.exs index 454c910c87..73aecf7810 100644 --- a/priv/perf/config/config.exs +++ b/priv/perf/config/config.exs @@ -19,9 +19,10 @@ config :load_test, watcher_info_url: System.get_env("WATCHER_INFO_URL"), faucet_private_key: System.get_env("LOAD_TEST_FAUCET_PRIVATE_KEY"), eth_vault_address: System.get_env("CONTRACT_ADDRESS_ETH_VAULT"), - faucet_deposit_wei: trunc(:math.pow(10, 14)), - initial_funds_wei: trunc(:math.pow(10, 7)), - fee_wei: 1, + erc20_vault_address: System.get_env("CONTRACT_ADDRESS_ERC20_VAULT"), + test_currency: "0x0000000000000000000000000000000000000000", + faucet_deposit_amount: trunc(:math.pow(10, 14)), + fee_amount: 1, deposit_finality_margin: 10, gas_price: 2_000_000_000 diff --git a/priv/perf/config/stress.exs b/priv/perf/config/stress.exs index 523e690fca..e34803769b 100644 --- a/priv/perf/config/stress.exs +++ b/priv/perf/config/stress.exs @@ -1,14 +1,30 @@ use Mix.Config +# Target tps. +# Note that this is only a rough estimate and depends on the response time from the childchain. +# If the childchain is under high load, tps will drop. +tps = 100 + +# Must be >= than tps, _should_ be at least 2x tps +concurrency = 200 + +# Minutes that the test should run. +# Again, a rough estimate - if the childchain is under high load the test will take longer to finish +test_duration = 1 + +tx_delay = trunc(concurrency / tps) * 1000 +tx_per_session = trunc(test_duration * 60 / trunc(tx_delay / 1000)) + config :load_test, utxo_load_test_config: %{ - concurrent_sessions: 100, - utxos_to_create_per_session: 5000, - transactions_per_session: 100 + concurrent_sessions: 1, + utxos_to_create_per_session: 30, + transactions_per_session: 4 }, childchain_transactions_test_config: %{ - concurrent_sessions: 1000, - transactions_per_session: 10 + concurrent_sessions: concurrency, + transactions_per_session: tx_per_session, + transaction_delay: tx_delay }, watcher_info_test_config: %{ concurrent_sessions: 100, diff --git a/priv/perf/config/test.exs b/priv/perf/config/test.exs index bab4b76a0a..52f8273020 100644 --- a/priv/perf/config/test.exs +++ b/priv/perf/config/test.exs @@ -7,8 +7,7 @@ config :load_test, child_chain_url: "http://localhost:9656", watcher_security_url: "http://localhost:7434", watcher_info_url: "http://localhost:7534", - faucet_deposit_wei: trunc(:math.pow(10, 18) * 10), - initial_funds_wei: trunc(:math.pow(10, 17)), + faucet_deposit_amount: trunc(:math.pow(10, 18) * 10), utxo_load_test_config: %{ concurrent_sessions: 10, utxos_to_create_per_session: 5,