Scripts for running metric collections using the Recoder/Repalyer framework.
run_profiling
requires exactly 1 action and at least 1 metric
./run_profiling <action> <metrics>
For example, the following runs end-to-end profiling on two metrics: storage-update
and evm-call
. This includes running the replayer, extracting raw data, storing metrics to a database and generating metric graphs.
./run_profiling all storage-update evm-call
List of available actions
record
records substates and generate evm-call metrics data in a log file.replay
replays substates and generate metrics data in a log file.extract
extracts data from a log file and store in a database.plot
plots graphs for specified metrics.all
performs replay, extract and plot.
List of available metrics
storage-update
gets storage update size after each transactioncode-size
gets code size of smart contractsevm-call
gets runtime of evm callsevm-opcode
gets statistics of evm opcodes
sqlite3
database for storing metrics.gnuplot
for plotting metric graphs.
Before start the profiling script, parameters such as preferred file locations, block range and event file should be configured in ./run_profiling
.
DATABASE_FILE
: Sqlite3 database location where metrics are stored.
LOG_PATH
: Output path for generated logs from substate-cli command.
PNG_PATH
: Output path for metric graphs.
These parameters are required to execute replay
command.
WORKERS
: Number of worker threads that execute substates in parallel.
FIRST_BLOCK
: The first block to replay transactions.
LAST_BLOCK
: The last block to replay transaction (inclusive range).
These parameters are required to execute record
command.
EVENT_FILE
: Fantom event files exported from Fantom chain via opera export
.
GENESIS
: Fantom genesis file (optional).
OPERA_DATADIR
: Chaindata directory (optional).