-
Notifications
You must be signed in to change notification settings - Fork 51
TPS Benchmark
There are two ways to measure.
- Using
devel_testTPS
RPC Call (Implemented only on solo chain) - Using the test code with the SDK (Not implemented yet)
There are four options: PaymentOnly
, TransferSingle
, TransferMultiple
, PaymentOrTransfer
.
PaymentOnly
will send a 1 CCC from the faucet address to a random address by payment actions for count
times.
Request Example
curl \
-H 'Content-Type: application/json' \
-d '{"jsonrpc": "2.0", "method": "devel_testTPS", "params": [{"option":"payOnly", "count":10000, "seed": 1 }], "id": null}' \
localhost:8080
TransferSingle
will mint an asset, and send the asset from one to another for count
times.
This uses 0x30, 0x01
lock script, which always return Unlocked
.
Request Example
curl \
-H 'Content-Type: application/json' \
-d '{"jsonrpc": "2.0", "method": "devel_testTPS", "params": [{"option":"transferSingle", "count":10000, "seed": 1 }], "id": null}' \
localhost:8080
TransferMultiple
will mint an asset, and split it into 10 assets, and send the split assets from one to another for count
times.
This uses 0x30, 0x01
lock script, which always return Unlocked
.
Request Example
curl \
-H 'Content-Type: application/json' \
-d '{"jsonrpc": "2.0", "method": "devel_testTPS", "params": [{"option":"transferMultiple", "count":10000, "seed": 1 }], "id": null}' \
localhost:8080
PaymentOrTransfer
will randomly choose and do an action from PaymentOnly
and TransferSingle
, for count
times.
When choosing an action, this will use SmallRng
PRNG with the given seed. Check the request example below.
Request Example
curl \
-H 'Content-Type: application/json' \
-d '{"jsonrpc": "2.0", "method": "devel_testTPS", "params": [{"option":"payOrTransfer", "count":10000, "seed": 1 }], "id": null}' \
localhost:8080
- Only
PaymentOrTransfer
has aseed
value.
Not implemented yet.
-
linux-tools-common
to installperf
- Edit Cargo.toml
sudo sysctl -w kernel.perf_event_paranoid=-1
perf record --call-graph dwarf,16384 -e cpu-clock -F 997 target/release/codechain -c solo --enable-devel-api
See this document for more information.