Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: test tx generation can't be run in parallel #1596

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions testground/benchmark/benchmark/stateless.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import tempfile
import time
from pathlib import Path
from typing import List
from typing import List, Optional

import click
import tomlkit
Expand Down Expand Up @@ -203,6 +203,7 @@ def run(outdir: str, datadir: str, cronosd, global_seq):
@click.option("--nodes", default=10)
@click.option("--num-accounts", default=10)
@click.option("--num-txs", default=1000)
@click.option("--node", type=int)
def gen_txs(**kwargs):
return _gen_txs(**kwargs)

Expand All @@ -218,14 +219,22 @@ def _gen_txs(
nodes: int = 10,
num_accounts: int = 10,
num_txs: int = 1000,
node: Optional[int] = None,
):
outdir = Path(outdir)
for global_seq in range(nodes):

def job(global_seq):
print("generating", num_accounts * num_txs, "txs for node", global_seq)
txs = transaction.gen(global_seq, num_accounts, num_txs)
transaction.save(txs, outdir, global_seq)
print("saved", len(txs), "txs for node", global_seq)

if node is not None:
job(node)
else:
for global_seq in range(nodes):
job(global_seq)


def do_run(
datadir: Path, home: Path, cronosd: str, group: str, global_seq: int, cfg: dict
Expand Down
Loading