Skip to content

Commit

Permalink
Performance deme updates
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Costanzo <[email protected]>
  • Loading branch information
ianco committed Mar 1, 2022
1 parent ecac257 commit debd50b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
16 changes: 16 additions & 0 deletions demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,22 @@ The script starts both agents, runs the performance test, spits out performance

A second version of the performance test can be run by adding the parameter `--routing` to the invocation above. The parameter triggers the example to run with Alice using a routing agent such that all messages pass through the routing agent between Alice and Faber. This is a good, simple example of how routing can be implemented with DIDComm agents.

You can also run the demo against a postgres database using the following:

```bash
./run_demo performance --arg-file demo/postgres-indy-args.yml
```

(Obvs you need to be running a postgres database - the command to start postgres is in the yml file provided above.)

You can tweak the number of credentials issued using the `--cound` and --batch` prameters, and you can run against an askar database using the `--askar` option.

An example full set of options is:

```bash
./run_demo performance --arg-file demo/postgres-indy-args.yml -c 10000 -b 10 --wallet-type askar
```

## Coding Challenge: Adding ACME

Now that you have a solid foundation in using ACA-Py, time for a coding challenge. In this challenge, we extend the Alice-Faber command line demo by adding in ACME Corp, a place where Alice wants to work. The demo adds:
Expand Down
21 changes: 19 additions & 2 deletions demo/runners/performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,9 @@ async def main(
revocation: bool = False,
tails_server_base_url: str = None,
issue_count: int = 300,
batch_size: int = 30,
wallet_type: str = None,
arg_file: str = None,
):

if multi_ledger:
Expand Down Expand Up @@ -295,6 +297,7 @@ async def main(
multitenant=multitenant,
mediation=mediation,
wallet_type=wallet_type,
arg_file=arg_file,
)
await alice.listen_webhooks(start_port + 2)

Expand All @@ -307,6 +310,7 @@ async def main(
multitenant=multitenant,
mediation=mediation,
wallet_type=wallet_type,
arg_file=arg_file,
)
await faber.listen_webhooks(start_port + 5)
await faber.register_did()
Expand Down Expand Up @@ -371,8 +375,6 @@ async def main(
await alice_mediator_agent.reset_timing()
await faber_mediator_agent.reset_timing()

batch_size = 100

semaphore = asyncio.Semaphore(threads)

def done_propose(fut: asyncio.Task):
Expand Down Expand Up @@ -591,6 +593,13 @@ async def check_received_pings(agent, issue_count, pb):
default=300,
help="Set the number of credentials to issue",
)
parser.add_argument(
"-b",
"--batch",
type=int,
default=100,
help="Set the batch size of credentials to issue",
)
parser.add_argument(
"-p",
"--port",
Expand Down Expand Up @@ -655,6 +664,12 @@ async def check_received_pings(agent, issue_count, pb):
metavar="<wallet-type>",
help="Set the agent wallet type",
)
parser.add_argument(
"--arg-file",
type=str,
metavar="<arg-file>",
help="Specify a file containing additional aca-py parameters",
)
args = parser.parse_args()

if args.did_exchange and args.mediation:
Expand Down Expand Up @@ -690,7 +705,9 @@ async def check_received_pings(agent, issue_count, pb):
args.revocation,
tails_server_base_url,
args.count,
args.batch,
args.wallet_type,
args.arg_file,
)
)
except KeyboardInterrupt:
Expand Down

0 comments on commit debd50b

Please sign in to comment.